[jboss-cvs] JBossAS SVN: r83479 - in projects/microcontainer/tags: 2.0.3.GA and 23 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jan 27 08:04:52 EST 2009
Author: alesj
Date: 2009-01-27 08:04:51 -0500 (Tue, 27 Jan 2009)
New Revision: 83479
Added:
projects/microcontainer/tags/2.0.3.GA/
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/pom.xml
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/JndiLifecycleCallback.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValue.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValueAspect.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/POJO.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/iPOJO.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementTest.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorSimpleIfaceDeploymentTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.xml
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.xml
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.xml
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorSimpleIfaceDeploymentTestCase.xml
projects/microcontainer/tags/2.0.3.GA/build/pom.xml
projects/microcontainer/tags/2.0.3.GA/dependency/pom.xml
projects/microcontainer/tags/2.0.3.GA/guice-int/pom.xml
projects/microcontainer/tags/2.0.3.GA/kernel/pom.xml
projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInjectionValueMetaData.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/SecurityActions.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/PrivilegedBean.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/SimpleScopedClassLoader.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FirstBean.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/GetInstanceBean.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/HAPartition.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/HAPartitionCacheHandler.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/RealTM.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SecondBean.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SomeCacheTreeManager.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemand.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemandAnnotationPlugin.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemandCreator.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/GetInstanceTestCase.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/MockEjb3DependsTestCase.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingDependencyTestCase.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/SuperDemandAnnotationTestCase.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/SuperDemandInstallTestCase.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.xml
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.xml
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/GetInstanceTestCase.xml
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/MockEjb3DependsTestCase.xml
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/SuperDemandAnnotationTestCase.xml
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/SuperDemandInstallTestCase.xml
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.xml
projects/microcontainer/tags/2.0.3.GA/pom.xml
projects/microcontainer/tags/2.0.3.GA/spring-int/pom.xml
Removed:
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/pom.xml
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/JndiLifecycleCallback.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValue.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValueAspect.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/POJO.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementTest.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.xml
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.xml
projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.xml
projects/microcontainer/tags/2.0.3.GA/build/pom.xml
projects/microcontainer/tags/2.0.3.GA/dependency/pom.xml
projects/microcontainer/tags/2.0.3.GA/guice-int/pom.xml
projects/microcontainer/tags/2.0.3.GA/kernel/pom.xml
projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInjectionValueMetaData.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/SecurityActions.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/PrivilegedBean.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/SimpleScopedClassLoader.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingDependencyTestCase.java
projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.xml
projects/microcontainer/tags/2.0.3.GA/pom.xml
projects/microcontainer/tags/2.0.3.GA/spring-int/pom.xml
Log:
[maven-release-plugin] copy for tag 2.0.3.GA
Copied: projects/microcontainer/tags/2.0.3.GA (from rev 83459, projects/microcontainer/branches/Branch_2_0)
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/pom.xml
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/pom.xml 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,640 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <!--
- - AOP Integration module.
- - This modules includes 4 different test configurations: weave, no-weave, weave-secure, and no-weave-secure
- - By default, none of the configurations will run. A single test configuration can be called using the
- - appropriate profile:
- - mvn -Ptests-weave-secure install
- -
- - All four surefire test configurations can be run using the property aop.tests.all
- - mvn -Daop.tests.all install
- -
- - Individual tests can be run by activating the appropriate profiles, then specifying the tests to run
- - mvn -Ptests-weave,tests-no-weave-secure -Dtest=TypeDefAopTestCase install
- -->
- <parent>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-microcontainer</artifactId>
- <version>2.0.3-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-aop-mc-int</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Microcontainer AOP MC INT</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Microcontainer</description>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/impl.xml</descriptor>
- <descriptor>src/assembly/aspects.xml</descriptor>
- </descriptors>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>weave</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>true</skip>
- <includes>
- <include>org/jboss/test/**/*TestCase.java</include>
- </includes>
- <useSystemClassLoader>true</useSystemClassLoader>
- <argLine>-Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader</argLine>
- <reportsDirectory>${project.build.directory}/surefire-reports/weave</reportsDirectory>
- <systemProperties>
- <property>
- <name>jboss.aop.exclude</name>
- <value>org.jboss.,org.apache.</value>
- </property>
- <property>
- <name>jboss.aop.include</name>
- <value>org.jboss.test.</value>
- </property>
- <property>
- <name>jboss-junit-configuration</name>
- <value>weave</value>
- </property>
- <property>
- <name>build.testlog</name>
- <value>target/log</value>
- </property>
- <property>
- <name>jboss.aop.verbose</name>
- <value>true</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- <execution>
- <id>weave-secure</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>true</skip>
- <reportsDirectory>${project.build.directory}/surefire-reports/weave-secure</reportsDirectory>
- <includes>
- <include>org/jboss/test/**/*TestCase.java</include>
- </includes>
- <useSystemClassLoader>true</useSystemClassLoader>
- <argLine>-Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader</argLine>
- <systemProperties>
- <property>
- <name>jboss.aop.exclude</name>
- <value>org.jboss.,org.apache.</value>
- </property>
- <property>
- <name>jboss.aop.include</name>
- <value>org.jboss.test.</value>
- </property>
- <property>
- <name>jboss-junit-configuration</name>
- <value>weave</value>
- </property>
- <property>
- <name>build.testlog</name>
- <value>target/log</value>
- </property>
- <property>
- <name>jboss.mc.secure</name>
- <value>true</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- <execution>
- <id>no-weave</id>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>true</skip>
- <reportsDirectory>${project.build.directory}/surefire-reports/no-weave</reportsDirectory>
- <includes>
- <include>org/jboss/test/microcontainer/test/**/*TestCase.java</include>
- <include>org/jboss/test/microcontainer/beans/test/**/*TestCase.java</include>
- <include>org/jboss/test/microcontainer/annotatedaop/test/**/*TestCase.java</include>
- </includes>
- <systemProperties>
- <property>
- <name>jboss-junit-configuration</name>
- <value>no_weave</value>
- </property>
- <property>
- <name>build.testlog</name>
- <value>target/log</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- <execution>
- <id>no-weave-secure</id>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>true</skip>
- <reportsDirectory>${project.build.directory}/surefire-reports/no-weave-secure</reportsDirectory>
- <includes>
- <include>org/jboss/test/microcontainer/test/**/*TestCase.java</include>
- <include>org/jboss/test/microcontainer/beans/test/**/*TestCase.java</include>
- <include>org/jboss/test/microcontainer/annotatedaop/test/**/*TestCase.java</include>
- </includes>
- <systemProperties>
- <property>
- <name>jboss-junit-configuration</name>
- <value>no_weave</value>
- </property>
- <property>
- <name>build.testlog</name>
- <value>target/log</value>
- </property>
- <property>
- <name>jboss.mc.secure</name>
- <value>true</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- </executions>
- <configuration>
- <testFailureIgnore>true</testFailureIgnore>
- <forkMode>always</forkMode>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
- <skip>true</skip>
- <trimStackTrace>false</trimStackTrace>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-test</artifactId>
- <version>${version.org.jboss.test}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${version.junit}</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <!-- Do not add version information here, use ../pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-xerces</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-container</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-managed</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- </dependency>
- <!-- Test dependencies -->
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test</groupId>
- <artifactId>jboss-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>tests-weave</id>
- <activation>
- <property>
- <name>aop.tests.all</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>weave</id>
- <configuration>
- <skip>false</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <configuration>
- <reportsDirectory>${project.build.directory}/surefire-reports/weave</reportsDirectory>
- <outputName>surefire-report-weave</outputName>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>tests-weave-secure</id>
- <activation>
- <property>
- <name>aop.tests.all</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>weave-secure</id>
- <configuration>
- <skip>false</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <configuration>
- <reportsDirectory>${project.build.directory}/surefire-reports/weave-secure</reportsDirectory>
- <outputName>surefire-report-weave-secure</outputName>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>tests-no-weave</id>
- <activation>
- <property>
- <name>aop.tests.all</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>no-weave</id>
- <configuration>
- <skip>false</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <configuration>
- <reportsDirectory>${project.build.directory}/surefire-reports/no-weave</reportsDirectory>
- <outputName>surefire-report-no-weave</outputName>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>tests-no-weave-secure</id>
- <activation>
- <property>
- <name>aop.tests.all</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>no-weave-secure</id>
- <configuration>
- <skip>false</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <configuration>
- <reportsDirectory>${project.build.directory}/surefire-reports/no-weave-secure</reportsDirectory>
- <outputName>surefire-report-no-weave-secure</outputName>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>ant-tests-weave</id>
- <activation>
- <property>
- <name>ant-tests-weave</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <id>ant-tests-weave</id>
- <phase>test</phase>
- <configuration>
- <tasks>
- <property name="plugin_classpath" refid="maven.plugin.classpath" />
- <echo message="plugin classpath: ${plugin_classpath}" />
- <mkdir dir="${project.build.directory}/surefire-reports/ant-weave" />
- <property name="build.testlog" value="${project.build.directory}/log" />
- <mkdir dir="${build.testlog}" />
- <!-- Remove the test.log so each run has a fresh log -->
- <delete file="${build.testlog}/test.log" />
- <junit dir="${project.build.directory}" printsummary="yes" haltonerror="false" haltonfailure="false" fork="true">
-
- <sysproperty key="jboss.aop.exclude" value="org.jboss.,org.apache." />
- <sysproperty key="jboss.aop.include" value="org.jboss.test." />
- <sysproperty key="jboss-junit-configuration" value="weave" />
- <sysproperty key="build.testlog" value="${build.testlog}" />
- <sysproperty key="java.system.class.loader" value="org.jboss.aop.standalone.SystemClassLoader" />
-
- <classpath>
- <path refid="maven.test.classpath" />
- </classpath>
-
- <formatter type="plain" usefile="true" extension=".txt" />
- <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter" usefile="true" extension=".xml" />
-
- <batchtest todir="${project.build.directory}/surefire-reports/ant-weave" haltonerror="false" haltonfailure="false" fork="true">
-
- <fileset dir="${project.build.directory}/test-classes">
- <include name="org/jboss/test/**/*TestCase.class" />
- </fileset>
- </batchtest>
- </junit>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-junit</artifactId>
- <version>${version.ant.junit}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${version.junit}</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <configuration>
- <reportsDirectory>${project.build.directory}/surefire-reports/ant-weave</reportsDirectory>
- <outputName>surefire-report-ant-weave</outputName>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>ant-one-test-weave</id>
- <activation>
- <property>
- <name>ant-one-test-weave</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <id>ant-one-test-weave</id>
- <phase>test</phase>
- <configuration>
- <tasks>
- <property name="plugin_classpath" refid="maven.plugin.classpath" />
- <echo message="plugin classpath: ${plugin_classpath}" />
- <mkdir dir="${project.build.directory}/surefire-reports/ant-one-weave" />
- <property name="build.testlog" value="${project.build.directory}/log" />
- <mkdir dir="${build.testlog}" />
- <!-- Remove the test.log so each run has a fresh log -->
- <delete file="${build.testlog}/test.log" />
- <junit dir="${project.build.directory}" printsummary="yes" haltonerror="false" haltonfailure="false" fork="true">
-
- <sysproperty key="jboss.aop.exclude" value="org.jboss.,org.apache." />
- <sysproperty key="jboss.aop.include" value="org.jboss.test." />
- <sysproperty key="jboss-junit-configuration" value="weave" />
- <sysproperty key="build.testlog" value="${build.testlog}" />
- <sysproperty key="java.system.class.loader" value="org.jboss.aop.standalone.SystemClassLoader" />
-
- <classpath>
- <path refid="maven.test.classpath" />
- </classpath>
-
- <formatter type="plain" usefile="true" extension=".txt" />
- <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter" usefile="true" extension=".xml" />
-
- <test todir="${project.build.directory}/surefire-reports/ant-one-weave" name="${test}" haltonerror="false" haltonfailure="false" fork="true" />
-
- </junit>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-junit</artifactId>
- <version>${version.ant.junit}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${version.junit}</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <configuration>
- <reportsDirectory>${project.build.directory}/surefire-reports/ant-weave</reportsDirectory>
- <outputName>surefire-report-ant-weave</outputName>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>ant-tests-weave-secure</id>
- <activation>
- <property>
- <name>ant-tests-weave-secure</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>ant-tests-weave-secure</id>
- <phase>test</phase>
- <configuration>
- <tasks>
- <mkdir dir="${project.build.directory}/surefire-reports/ant-weave-secure" />
- <property name="build.testlog" value="${project.build.directory}/log" />
- <mkdir dir="${build.testlog}" />
- <!-- Remove the test.log so each run has a fresh log -->
- <delete file="${build.testlog}/test.log" />
- <junit dir="${project.build.directory}" printsummary="yes" haltonerror="false" haltonfailure="false" fork="true">
-
- <sysproperty key="jboss.aop.exclude" value="org.jboss.,org.apache." />
- <sysproperty key="jboss.aop.include" value="org.jboss.test." />
- <sysproperty key="jboss-junit-configuration" value="weave-secure" />
- <sysproperty key="build.testlog" value="${build.testlog}" />
- <sysproperty key="java.system.class.loader" value="org.jboss.aop.standalone.SystemClassLoader" />
- <sysproperty key="jboss.mc.secure" value="true" />
-
- <classpath>
- <path refid="maven.test.classpath" />
- </classpath>
-
- <formatter type="plain" usefile="true" extension=".txt" />
- <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter" usefile="true" extension=".xml" />
-
- <batchtest todir="${project.build.directory}/surefire-reports/ant-weave-secure" haltonerror="false" haltonfailure="false" fork="true">
-
- <fileset dir="${project.build.directory}/test-classes">
- <include name="org/jboss/test/**/*TestCase.class" />
- </fileset>
- </batchtest>
- </junit>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-junit</artifactId>
- <version>${version.ant.junit}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${version.junit}</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <configuration>
- <reportsDirectory>${project.build.directory}/surefire-reports/ant-weave-secure</reportsDirectory>
- <outputName>surefire-report-ant-weave-secure</outputName>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/pom.xml (from rev 83478, projects/microcontainer/branches/Branch_2_0/aop-mc-int/pom.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/pom.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,640 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <!--
+ - AOP Integration module.
+ - This modules includes 4 different test configurations: weave, no-weave, weave-secure, and no-weave-secure
+ - By default, none of the configurations will run. A single test configuration can be called using the
+ - appropriate profile:
+ - mvn -Ptests-weave-secure install
+ -
+ - All four surefire test configurations can be run using the property aop.tests.all
+ - mvn -Daop.tests.all install
+ -
+ - Individual tests can be run by activating the appropriate profiles, then specifying the tests to run
+ - mvn -Ptests-weave,tests-no-weave-secure -Dtest=TypeDefAopTestCase install
+ -->
+ <parent>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-microcontainer</artifactId>
+ <version>2.0.3.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-aop-mc-int</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Microcontainer AOP MC INT</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Microcontainer</description>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/impl.xml</descriptor>
+ <descriptor>src/assembly/aspects.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>weave</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>true</skip>
+ <includes>
+ <include>org/jboss/test/**/*TestCase.java</include>
+ </includes>
+ <useSystemClassLoader>true</useSystemClassLoader>
+ <argLine>-Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader</argLine>
+ <reportsDirectory>${project.build.directory}/surefire-reports/weave</reportsDirectory>
+ <systemProperties>
+ <property>
+ <name>jboss.aop.exclude</name>
+ <value>org.jboss.,org.apache.</value>
+ </property>
+ <property>
+ <name>jboss.aop.include</name>
+ <value>org.jboss.test.</value>
+ </property>
+ <property>
+ <name>jboss-junit-configuration</name>
+ <value>weave</value>
+ </property>
+ <property>
+ <name>build.testlog</name>
+ <value>target/log</value>
+ </property>
+ <property>
+ <name>jboss.aop.verbose</name>
+ <value>true</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>weave-secure</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>true</skip>
+ <reportsDirectory>${project.build.directory}/surefire-reports/weave-secure</reportsDirectory>
+ <includes>
+ <include>org/jboss/test/**/*TestCase.java</include>
+ </includes>
+ <useSystemClassLoader>true</useSystemClassLoader>
+ <argLine>-Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader</argLine>
+ <systemProperties>
+ <property>
+ <name>jboss.aop.exclude</name>
+ <value>org.jboss.,org.apache.</value>
+ </property>
+ <property>
+ <name>jboss.aop.include</name>
+ <value>org.jboss.test.</value>
+ </property>
+ <property>
+ <name>jboss-junit-configuration</name>
+ <value>weave</value>
+ </property>
+ <property>
+ <name>build.testlog</name>
+ <value>target/log</value>
+ </property>
+ <property>
+ <name>jboss.mc.secure</name>
+ <value>true</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>no-weave</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>true</skip>
+ <reportsDirectory>${project.build.directory}/surefire-reports/no-weave</reportsDirectory>
+ <includes>
+ <include>org/jboss/test/microcontainer/test/**/*TestCase.java</include>
+ <include>org/jboss/test/microcontainer/beans/test/**/*TestCase.java</include>
+ <include>org/jboss/test/microcontainer/annotatedaop/test/**/*TestCase.java</include>
+ </includes>
+ <systemProperties>
+ <property>
+ <name>jboss-junit-configuration</name>
+ <value>no_weave</value>
+ </property>
+ <property>
+ <name>build.testlog</name>
+ <value>target/log</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ <execution>
+ <id>no-weave-secure</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>true</skip>
+ <reportsDirectory>${project.build.directory}/surefire-reports/no-weave-secure</reportsDirectory>
+ <includes>
+ <include>org/jboss/test/microcontainer/test/**/*TestCase.java</include>
+ <include>org/jboss/test/microcontainer/beans/test/**/*TestCase.java</include>
+ <include>org/jboss/test/microcontainer/annotatedaop/test/**/*TestCase.java</include>
+ </includes>
+ <systemProperties>
+ <property>
+ <name>jboss-junit-configuration</name>
+ <value>no_weave</value>
+ </property>
+ <property>
+ <name>build.testlog</name>
+ <value>target/log</value>
+ </property>
+ <property>
+ <name>jboss.mc.secure</name>
+ <value>true</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <testFailureIgnore>true</testFailureIgnore>
+ <forkMode>always</forkMode>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <skip>true</skip>
+ <trimStackTrace>false</trimStackTrace>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-test</artifactId>
+ <version>${version.org.jboss.test}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit}</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <!-- Do not add version information here, use ../pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-container</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test</groupId>
+ <artifactId>jboss-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>tests-weave</id>
+ <activation>
+ <property>
+ <name>aop.tests.all</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>weave</id>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <configuration>
+ <reportsDirectory>${project.build.directory}/surefire-reports/weave</reportsDirectory>
+ <outputName>surefire-report-weave</outputName>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>tests-weave-secure</id>
+ <activation>
+ <property>
+ <name>aop.tests.all</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>weave-secure</id>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <configuration>
+ <reportsDirectory>${project.build.directory}/surefire-reports/weave-secure</reportsDirectory>
+ <outputName>surefire-report-weave-secure</outputName>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>tests-no-weave</id>
+ <activation>
+ <property>
+ <name>aop.tests.all</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>no-weave</id>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <configuration>
+ <reportsDirectory>${project.build.directory}/surefire-reports/no-weave</reportsDirectory>
+ <outputName>surefire-report-no-weave</outputName>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>tests-no-weave-secure</id>
+ <activation>
+ <property>
+ <name>aop.tests.all</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>no-weave-secure</id>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <configuration>
+ <reportsDirectory>${project.build.directory}/surefire-reports/no-weave-secure</reportsDirectory>
+ <outputName>surefire-report-no-weave-secure</outputName>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>ant-tests-weave</id>
+ <activation>
+ <property>
+ <name>ant-tests-weave</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <id>ant-tests-weave</id>
+ <phase>test</phase>
+ <configuration>
+ <tasks>
+ <property name="plugin_classpath" refid="maven.plugin.classpath" />
+ <echo message="plugin classpath: ${plugin_classpath}" />
+ <mkdir dir="${project.build.directory}/surefire-reports/ant-weave" />
+ <property name="build.testlog" value="${project.build.directory}/log" />
+ <mkdir dir="${build.testlog}" />
+ <!-- Remove the test.log so each run has a fresh log -->
+ <delete file="${build.testlog}/test.log" />
+ <junit dir="${project.build.directory}" printsummary="yes" haltonerror="false" haltonfailure="false" fork="true">
+
+ <sysproperty key="jboss.aop.exclude" value="org.jboss.,org.apache." />
+ <sysproperty key="jboss.aop.include" value="org.jboss.test." />
+ <sysproperty key="jboss-junit-configuration" value="weave" />
+ <sysproperty key="build.testlog" value="${build.testlog}" />
+ <sysproperty key="java.system.class.loader" value="org.jboss.aop.standalone.SystemClassLoader" />
+
+ <classpath>
+ <path refid="maven.test.classpath" />
+ </classpath>
+
+ <formatter type="plain" usefile="true" extension=".txt" />
+ <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter" usefile="true" extension=".xml" />
+
+ <batchtest todir="${project.build.directory}/surefire-reports/ant-weave" haltonerror="false" haltonfailure="false" fork="true">
+
+ <fileset dir="${project.build.directory}/test-classes">
+ <include name="org/jboss/test/**/*TestCase.class" />
+ </fileset>
+ </batchtest>
+ </junit>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ <version>${version.ant.junit}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <configuration>
+ <reportsDirectory>${project.build.directory}/surefire-reports/ant-weave</reportsDirectory>
+ <outputName>surefire-report-ant-weave</outputName>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>ant-one-test-weave</id>
+ <activation>
+ <property>
+ <name>ant-one-test-weave</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <id>ant-one-test-weave</id>
+ <phase>test</phase>
+ <configuration>
+ <tasks>
+ <property name="plugin_classpath" refid="maven.plugin.classpath" />
+ <echo message="plugin classpath: ${plugin_classpath}" />
+ <mkdir dir="${project.build.directory}/surefire-reports/ant-one-weave" />
+ <property name="build.testlog" value="${project.build.directory}/log" />
+ <mkdir dir="${build.testlog}" />
+ <!-- Remove the test.log so each run has a fresh log -->
+ <delete file="${build.testlog}/test.log" />
+ <junit dir="${project.build.directory}" printsummary="yes" haltonerror="false" haltonfailure="false" fork="true">
+
+ <sysproperty key="jboss.aop.exclude" value="org.jboss.,org.apache." />
+ <sysproperty key="jboss.aop.include" value="org.jboss.test." />
+ <sysproperty key="jboss-junit-configuration" value="weave" />
+ <sysproperty key="build.testlog" value="${build.testlog}" />
+ <sysproperty key="java.system.class.loader" value="org.jboss.aop.standalone.SystemClassLoader" />
+
+ <classpath>
+ <path refid="maven.test.classpath" />
+ </classpath>
+
+ <formatter type="plain" usefile="true" extension=".txt" />
+ <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter" usefile="true" extension=".xml" />
+
+ <test todir="${project.build.directory}/surefire-reports/ant-one-weave" name="${test}" haltonerror="false" haltonfailure="false" fork="true" />
+
+ </junit>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ <version>${version.ant.junit}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <configuration>
+ <reportsDirectory>${project.build.directory}/surefire-reports/ant-weave</reportsDirectory>
+ <outputName>surefire-report-ant-weave</outputName>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>ant-tests-weave-secure</id>
+ <activation>
+ <property>
+ <name>ant-tests-weave-secure</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>ant-tests-weave-secure</id>
+ <phase>test</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${project.build.directory}/surefire-reports/ant-weave-secure" />
+ <property name="build.testlog" value="${project.build.directory}/log" />
+ <mkdir dir="${build.testlog}" />
+ <!-- Remove the test.log so each run has a fresh log -->
+ <delete file="${build.testlog}/test.log" />
+ <junit dir="${project.build.directory}" printsummary="yes" haltonerror="false" haltonfailure="false" fork="true">
+
+ <sysproperty key="jboss.aop.exclude" value="org.jboss.,org.apache." />
+ <sysproperty key="jboss.aop.include" value="org.jboss.test." />
+ <sysproperty key="jboss-junit-configuration" value="weave-secure" />
+ <sysproperty key="build.testlog" value="${build.testlog}" />
+ <sysproperty key="java.system.class.loader" value="org.jboss.aop.standalone.SystemClassLoader" />
+ <sysproperty key="jboss.mc.secure" value="true" />
+
+ <classpath>
+ <path refid="maven.test.classpath" />
+ </classpath>
+
+ <formatter type="plain" usefile="true" extension=".txt" />
+ <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter" usefile="true" extension=".xml" />
+
+ <batchtest todir="${project.build.directory}/surefire-reports/ant-weave-secure" haltonerror="false" haltonfailure="false" fork="true">
+
+ <fileset dir="${project.build.directory}/test-classes">
+ <include name="org/jboss/test/**/*TestCase.class" />
+ </fileset>
+ </batchtest>
+ </junit>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ <version>${version.ant.junit}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <configuration>
+ <reportsDirectory>${project.build.directory}/surefire-reports/ant-weave-secure</reportsDirectory>
+ <outputName>surefire-report-ant-weave-secure</outputName>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/JndiLifecycleCallback.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/JndiLifecycleCallback.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/JndiLifecycleCallback.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,182 +0,0 @@
-/*
-* 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.aspects.jndi;
-
-import java.util.Properties;
-
-import javax.naming.InitialContext;
-
-import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.aop.joinpoint.MethodInvocation;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.spi.MetaData;
-import org.jboss.util.naming.Util;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class JndiLifecycleCallback
-{
- private static final Logger log = Logger.getLogger(JndiLifecycleCallback.class);
- private Properties env;
-
- public String getName()
- {
- return getClass().getName();
- }
-
- /**
- * Get the InitialContext properties to use for binding/unbinding
- * @return the InitialContext ctor env
- */
- public Properties getEnv()
- {
- return env;
- }
-
- /**
- * Set the InitialContext properties to use for binding/unbinding
- * @param env - the InitialContext ctor env
- */
- public void setEnv(Properties env)
- {
- this.env = env;
- }
-
- /**
- * Bind the target on setKernelControllerContext, unbind on any other method provided that
- * the invocation has a JndiBinding annotation.
- *
- * @param invocation the invocation
- * @return the result
- * @throws Throwable for any error
- */
- public Object invoke(Invocation invocation) throws Throwable
- {
- MethodInvocation mi = (MethodInvocation) invocation;
- KernelControllerContext context = (KernelControllerContext) mi.getArguments()[0];
-
- boolean trace = log.isTraceEnabled();
- JndiBinding bindingInfo = (JndiBinding) invocation.resolveClassAnnotation(JndiBinding.class);
- if( trace )
- log.trace("Checking method: "+mi.getMethod()+", bindingInfo: "+bindingInfo);
- // If this is the setKernelControllerContext callback, bind the target into jndi
- if ("setKernelControllerContext".equals(mi.getMethod().getName()) && bindingInfo != null)
- {
- InitialContext ctx = new InitialContext(env);
- Object target = context.getTarget();
- Util.bind(ctx, bindingInfo.name(), target);
- if( trace )
- log.trace("Bound to: "+bindingInfo.name());
- String[] aliases = bindingInfo.aliases();
- if( aliases != null )
- {
- for(String name : aliases)
- {
- Util.bind(ctx, name, target);
- if( trace )
- log.trace("Bound to alias: "+bindingInfo.name());
- }
- }
- }
- // If this is the unsetKernelControllerContext callback, unbind the target
- else if( bindingInfo != null )
- {
- InitialContext ctx = new InitialContext(env);
- Util.unbind(ctx, bindingInfo.name());
- if( trace )
- log.trace("Unbound: "+bindingInfo.name());
- String[] aliases = bindingInfo.aliases();
- if( aliases != null )
- {
- for(String name : aliases)
- {
- Util.unbind(ctx, name);
- if( trace )
- log.trace("Unbound alias: "+bindingInfo.name());
- }
- }
- }
- else if ( trace )
- {
- log.trace("Ignoring null binding info");
- }
-
- return null;
- }
-
- public void install(ControllerContext context) throws Exception
- {
- JndiBinding bindingInfo = readJndiAnnotation(context);
- boolean trace = log.isTraceEnabled();
- if( trace )
- log.trace("Binding into JNDI: " + context.getName() + ", bindingInfo: " + bindingInfo);
- // If this is the setKernelControllerContext callback, bind the target into jndi
- InitialContext ctx = new InitialContext(env);
- Object target = context.getTarget();
- Util.bind(ctx, bindingInfo.name(), target);
- if( trace )
- log.trace("Bound to: "+bindingInfo.name());
- String[] aliases = bindingInfo.aliases();
- if( aliases != null )
- {
- for(String name : aliases)
- {
- Util.bind(ctx, name, target);
- if( trace )
- log.trace("Bound to alias: "+bindingInfo.name());
- }
- }
- }
-
- public void uninstall(ControllerContext context) throws Exception
- {
- JndiBinding bindingInfo = readJndiAnnotation(context);
- boolean trace = log.isTraceEnabled();
- InitialContext ctx = new InitialContext(env);
- Util.unbind(ctx, bindingInfo.name());
- if( trace )
- log.trace("Unbound: "+bindingInfo.name());
- String[] aliases = bindingInfo.aliases();
- if( aliases != null )
- {
- for(String name : aliases)
- {
- Util.unbind(ctx, name);
- if( trace )
- log.trace("Unbound alias: "+bindingInfo.name());
- }
- }
- }
-
- private JndiBinding readJndiAnnotation(ControllerContext context)
- {
- MetaData metaData = context.getScopeInfo().getMetaData();
- if (metaData != null)
- return metaData.getAnnotation(JndiBinding.class);
- return null;
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/JndiLifecycleCallback.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/JndiLifecycleCallback.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/JndiLifecycleCallback.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/JndiLifecycleCallback.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,184 @@
+/*
+* 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.aspects.jndi;
+
+import java.util.Properties;
+
+import javax.naming.InitialContext;
+
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.joinpoint.MethodInvocation;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.util.naming.Util;
+
+/**
+ * The jndi lifecycle callback.
+ * This puts the beans marked with @JndiBinding into jndi.
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class JndiLifecycleCallback
+{
+ private static final Logger log = Logger.getLogger(JndiLifecycleCallback.class);
+ private Properties env;
+
+ public String getName()
+ {
+ return getClass().getName();
+ }
+
+ /**
+ * Get the InitialContext properties to use for binding/unbinding
+ * @return the InitialContext ctor env
+ */
+ public Properties getEnv()
+ {
+ return env;
+ }
+
+ /**
+ * Set the InitialContext properties to use for binding/unbinding
+ * @param env - the InitialContext ctor env
+ */
+ public void setEnv(Properties env)
+ {
+ this.env = env;
+ }
+
+ /**
+ * Bind the target on setKernelControllerContext, unbind on any other method provided that
+ * the invocation has a JndiBinding annotation.
+ *
+ * @param invocation the invocation
+ * @return the result
+ * @throws Throwable for any error
+ */
+ public Object invoke(Invocation invocation) throws Throwable
+ {
+ MethodInvocation mi = (MethodInvocation) invocation;
+ KernelControllerContext context = (KernelControllerContext) mi.getArguments()[0];
+
+ boolean trace = log.isTraceEnabled();
+ JndiBinding bindingInfo = (JndiBinding) invocation.resolveClassAnnotation(JndiBinding.class);
+ if( trace )
+ log.trace("Checking method: "+mi.getMethod()+", bindingInfo: "+bindingInfo);
+ // If this is the setKernelControllerContext callback, bind the target into jndi
+ if ("setKernelControllerContext".equals(mi.getMethod().getName()) && bindingInfo != null)
+ {
+ InitialContext ctx = new InitialContext(env);
+ Object target = context.getTarget();
+ Util.bind(ctx, bindingInfo.name(), target);
+ if( trace )
+ log.trace("Bound to: "+bindingInfo.name());
+ String[] aliases = bindingInfo.aliases();
+ if( aliases != null )
+ {
+ for(String name : aliases)
+ {
+ Util.bind(ctx, name, target);
+ if( trace )
+ log.trace("Bound to alias: "+bindingInfo.name());
+ }
+ }
+ }
+ // If this is the unsetKernelControllerContext callback, unbind the target
+ else if( bindingInfo != null )
+ {
+ InitialContext ctx = new InitialContext(env);
+ Util.unbind(ctx, bindingInfo.name());
+ if( trace )
+ log.trace("Unbound: "+bindingInfo.name());
+ String[] aliases = bindingInfo.aliases();
+ if( aliases != null )
+ {
+ for(String name : aliases)
+ {
+ Util.unbind(ctx, name);
+ if( trace )
+ log.trace("Unbound alias: "+bindingInfo.name());
+ }
+ }
+ }
+ else if ( trace )
+ {
+ log.trace("Ignoring null binding info");
+ }
+
+ return null;
+ }
+
+ public void install(ControllerContext context) throws Exception
+ {
+ JndiBinding bindingInfo = readJndiAnnotation(context);
+ boolean trace = log.isTraceEnabled();
+ if( trace )
+ log.trace("Binding into JNDI: " + context.getName() + ", bindingInfo: " + bindingInfo);
+ // If this is the setKernelControllerContext callback, bind the target into jndi
+ InitialContext ctx = new InitialContext(env);
+ Object target = context.getTarget();
+ Util.bind(ctx, bindingInfo.name(), target);
+ if( trace )
+ log.trace("Bound to: "+bindingInfo.name());
+ String[] aliases = bindingInfo.aliases();
+ if( aliases != null )
+ {
+ for(String name : aliases)
+ {
+ Util.bind(ctx, name, target);
+ if( trace )
+ log.trace("Bound to alias: "+bindingInfo.name());
+ }
+ }
+ }
+
+ public void uninstall(ControllerContext context) throws Exception
+ {
+ JndiBinding bindingInfo = readJndiAnnotation(context);
+ boolean trace = log.isTraceEnabled();
+ InitialContext ctx = new InitialContext(env);
+ Util.unbind(ctx, bindingInfo.name());
+ if( trace )
+ log.trace("Unbound: "+bindingInfo.name());
+ String[] aliases = bindingInfo.aliases();
+ if( aliases != null )
+ {
+ for(String name : aliases)
+ {
+ Util.unbind(ctx, name);
+ if( trace )
+ log.trace("Unbound alias: "+bindingInfo.name());
+ }
+ }
+ }
+
+ private JndiBinding readJndiAnnotation(ControllerContext context)
+ {
+ MetaData metaData = context.getScopeInfo().getMetaData();
+ if (metaData != null)
+ return metaData.getAnnotation(JndiBinding.class);
+ return null;
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,34 +0,0 @@
-/*
-* 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;
-
-import org.jboss.beans.metadata.spi.factory.BeanFactory;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public interface BeanFactoryAwareAspectFactory
-{
- void setBeanFactory(BeanFactory factory);
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,34 @@
+/*
+* 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;
+
+import org.jboss.beans.metadata.spi.factory.BeanFactory;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface BeanFactoryAwareAspectFactory
+{
+ void setBeanFactory(BeanFactory factory);
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,166 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.aop.microcontainer.beans;
-
-import org.jboss.aop.Advisor;
-import org.jboss.aop.InstanceAdvisor;
-import org.jboss.aop.advice.GenericAspectFactory;
-import org.jboss.aop.joinpoint.Joinpoint;
-import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory;
-import org.jboss.beans.metadata.spi.factory.BeanFactory;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
-import org.jboss.logging.Logger;
-import org.jboss.util.xml.XmlLoadable;
-import org.w3c.dom.Element;
-
-/**
- * A GenericBeanAspectFactory.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision$
- */
-public class GenericBeanAspectFactory extends GenericAspectFactory implements KernelControllerContextAware, BeanFactoryAwareAspectFactory
-{
- private static final Logger log = Logger.getLogger(GenericBeanAspectFactory.class);
-
- protected BeanFactory factory;
-
- protected String name;
- protected String classname;
-
- protected Element element;
-
- protected KernelControllerContext context;
-
- public GenericBeanAspectFactory(String name, BeanFactory factory, Element element)
- {
- super(null, element);
- this.name = name;
- this.element = element;
- setBeanFactory(factory);
- }
-
- public void setBeanFactory(BeanFactory factory)
- {
- if (factory != null && factory instanceof GenericBeanFactory)
- {
- classname = ((GenericBeanFactory)factory).getBean();
- }
- this.factory = factory;
- }
-
- public String getAspectName()
- {
- return name;
- }
-
- public String getName()
- {
- //This must return the classname of the aspect, aop depends on that
- return classname;
- }
-
- @Override
- public String getClassname()
- {
- return classname;
- }
-
- public Object createPerVM()
- {
- return doCreate(null, null, null);
- }
-
- public Object createPerClass(Advisor advisor)
- {
- return doCreate(advisor, null, null);
- }
-
- public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
- {
- return doCreate(advisor, instanceAdvisor, null);
- }
-
- public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
- {
- return doCreate(advisor, null, jp);
- }
-
- public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
- {
- return doCreate(advisor, instanceAdvisor, jp);
- }
-
- public void setKernelControllerContext(KernelControllerContext context)
- {
- this.context = context;
- }
-
-
- public void unsetKernelControllerContext(KernelControllerContext context) throws Exception
- {
- this.context = null;
- }
-
- protected Object doCreate(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
- {
- try
- {
- final ClassLoader loader = getCreatingClassLoader(advisor);
- log.debug("Creating advice " + name + " with loader " + loader);
- if (factory instanceof ClassLoaderAwareGenericBeanFactory)
- {
- ((ClassLoaderAwareGenericBeanFactory)factory).pushLoader(loader);
- }
-
- Object object = factory.createBean();
-
- if (object instanceof XmlLoadable)
- {
- ((XmlLoadable)object).importXml(element);
- }
- configureInstance(object, advisor, instanceAdvisor, jp);
- return object;
- }
- catch (Throwable throwable)
- {
- throw new RuntimeException(throwable);
- }
- finally
- {
- if (factory instanceof ClassLoaderAwareGenericBeanFactory)
- {
- ((ClassLoaderAwareGenericBeanFactory)factory).popLoader();
- }
- }
- }
-
- private ClassLoader getCreatingClassLoader(Advisor advisor)
- {
- if (advisor == null)
- {
- return getLoader();
- }
- return SecurityActions.getClassLoader(advisor.getClass());
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,170 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, 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.aop.microcontainer.beans;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.GenericAspectFactory;
+import org.jboss.aop.joinpoint.Joinpoint;
+import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData;
+import org.jboss.beans.metadata.plugins.AbstractValueMetaData;
+import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.beans.metadata.spi.factory.BeanFactory;
+import org.jboss.kernel.plugins.config.Configurator;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
+import org.jboss.logging.Logger;
+import org.jboss.util.xml.XmlLoadable;
+import org.w3c.dom.Element;
+
+/**
+ * A GenericBeanAspectFactory.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public class GenericBeanAspectFactory extends GenericAspectFactory implements KernelControllerContextAware, BeanFactoryAwareAspectFactory
+{
+ private static final Logger log = Logger.getLogger(GenericBeanAspectFactory.class);
+
+ protected BeanFactory factory;
+
+ protected String name;
+ protected String classname;
+
+ protected Element element;
+
+ protected KernelControllerContext context;
+
+ public GenericBeanAspectFactory(String name, BeanFactory factory, Element element)
+ {
+ super(null, element);
+ this.name = name;
+ this.element = element;
+ setBeanFactory(factory);
+ }
+
+ public void setBeanFactory(BeanFactory factory)
+ {
+ if (factory != null && factory instanceof GenericBeanFactory)
+ {
+ classname = ((GenericBeanFactory)factory).getBean();
+ }
+ this.factory = factory;
+ }
+
+ public String getAspectName()
+ {
+ return name;
+ }
+
+ public String getName()
+ {
+ //This must return the classname of the aspect, aop depends on that
+ return classname;
+ }
+
+ @Override
+ public String getClassname()
+ {
+ return classname;
+ }
+
+ public Object createPerVM()
+ {
+ return doCreate(null, null, null);
+ }
+
+ public Object createPerClass(Advisor advisor)
+ {
+ return doCreate(advisor, null, null);
+ }
+
+ public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
+ {
+ return doCreate(advisor, instanceAdvisor, null);
+ }
+
+ public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
+ {
+ return doCreate(advisor, null, jp);
+ }
+
+ public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
+ {
+ return doCreate(advisor, instanceAdvisor, jp);
+ }
+
+ public void setKernelControllerContext(KernelControllerContext context)
+ {
+ this.context = context;
+ }
+
+
+ public void unsetKernelControllerContext(KernelControllerContext context) throws Exception
+ {
+ this.context = null;
+ }
+
+ protected Object doCreate(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
+ {
+ try
+ {
+ final ClassLoader loader = getCreatingClassLoader(advisor);
+ log.debug("Creating advice " + name + " with loader " + loader);
+ if (factory instanceof ClassLoaderAwareGenericBeanFactory)
+ {
+ ((ClassLoaderAwareGenericBeanFactory)factory).pushLoader(loader);
+ }
+
+ Object object = factory.createBean();
+
+ if (object instanceof XmlLoadable)
+ {
+ ((XmlLoadable)object).importXml(element);
+ }
+ configureInstance(object, advisor, instanceAdvisor, jp);
+ return object;
+ }
+ catch (Throwable throwable)
+ {
+ throw new RuntimeException(throwable);
+ }
+ finally
+ {
+ if (factory instanceof ClassLoaderAwareGenericBeanFactory)
+ {
+ ((ClassLoaderAwareGenericBeanFactory)factory).popLoader();
+ }
+ }
+ }
+
+ private ClassLoader getCreatingClassLoader(Advisor advisor)
+ {
+ if (advisor == null)
+ {
+ return getLoader();
+ }
+ return SecurityActions.getClassLoader(advisor.getClass());
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValue.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValue.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValue.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,32 +0,0 @@
-/*
-* 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;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public @interface AnnotationWithValue
-{
- int integer();
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValue.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValue.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValue.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValue.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,32 @@
+/*
+* 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;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public @interface AnnotationWithValue
+{
+ int integer();
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValueAspect.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValueAspect.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValueAspect.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,40 +0,0 @@
-/*
-* 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;
-
-import org.jboss.aop.joinpoint.Invocation;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class AnnotationWithValueAspect
-{
- public static AnnotationWithValue value;
-
- public Object advice(Invocation inv) throws Throwable
- {
- value = (AnnotationWithValue)inv.resolveClassAnnotation(AnnotationWithValue.class);
- return inv.invokeNext();
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValueAspect.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValueAspect.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValueAspect.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValueAspect.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,40 @@
+/*
+* 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;
+
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnnotationWithValueAspect
+{
+ public static AnnotationWithValue value;
+
+ public Object advice(Invocation inv) throws Throwable
+ {
+ value = (AnnotationWithValue)inv.resolveClassAnnotation(AnnotationWithValue.class);
+ return inv.invokeNext();
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,78 +0,0 @@
-/*
-* 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;
-
-import org.jboss.aop.Advisor;
-import org.jboss.aop.InstanceAdvisor;
-import org.jboss.aop.advice.AspectFactory;
-import org.jboss.aop.joinpoint.Joinpoint;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class AspectFactoryWithDependency implements AspectFactory
-{
- private POJO pojo;
-
- public Object createPerClass(Advisor advisor)
- {
- throw new RuntimeException("PER_VM only");
- }
-
- public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
- {
- throw new RuntimeException("PER_VM only");
- }
-
- public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
- {
- throw new RuntimeException("PER_VM only");
- }
-
- public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
- {
- throw new RuntimeException("PER_VM only");
- }
-
- public Object createPerVM()
- {
- return new DependencyFactoryAspect(pojo);
- }
-
- public String getName()
- {
- return this.getClass().getName();
- }
-
- public POJO getPojo()
- {
- return pojo;
- }
-
- public void setPojo(POJO pojo)
- {
- this.pojo = pojo;
- }
-
-}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -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.test.microcontainer.beans;
+
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.advice.AspectFactory;
+import org.jboss.aop.joinpoint.Joinpoint;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectFactoryWithDependency implements AspectFactory
+{
+ private POJO pojo;
+
+ public Object createPerClass(Advisor advisor)
+ {
+ throw new RuntimeException("PER_VM only");
+ }
+
+ public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
+ {
+ throw new RuntimeException("PER_VM only");
+ }
+
+ public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
+ {
+ throw new RuntimeException("PER_VM only");
+ }
+
+ public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
+ {
+ throw new RuntimeException("PER_VM only");
+ }
+
+ public Object createPerVM()
+ {
+ return new DependencyFactoryAspect(pojo);
+ }
+
+ public String getName()
+ {
+ return this.getClass().getName();
+ }
+
+ public POJO getPojo()
+ {
+ return pojo;
+ }
+
+ public void setPojo(POJO pojo)
+ {
+ this.pojo = pojo;
+ }
+
+}
\ No newline at end of file
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,46 +0,0 @@
-/*
-* 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;
-
-import org.jboss.aop.joinpoint.MethodInvocation;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class DependencyFactoryAspect
-{
- public POJO pojo;
- public static POJO invoked;
-
- public DependencyFactoryAspect(POJO pojo)
- {
- this.pojo = pojo;
- }
-
- public Object advice(MethodInvocation inv) throws Throwable
- {
- invoked = this.pojo;
- return inv.invokeNext();
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,46 @@
+/*
+* 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;
+
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DependencyFactoryAspect
+{
+ public POJO pojo;
+ public static POJO invoked;
+
+ public DependencyFactoryAspect(POJO pojo)
+ {
+ this.pojo = pojo;
+ }
+
+ public Object advice(MethodInvocation inv) throws Throwable
+ {
+ invoked = this.pojo;
+ return inv.invokeNext();
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/POJO.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/POJO.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/POJO.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,45 +0,0 @@
-/*
-* 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;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class POJO
-{
- public int method(int i)
- {
- return i * 2;
- }
-
- public void method()
- {
-
- }
-
- public void defaultMethod()
- {
-
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/POJO.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/POJO.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/POJO.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/POJO.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,46 @@
+/*
+* 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;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class POJO
+ implements iPOJO
+{
+ public int method(int i)
+ {
+ return i * 2;
+ }
+
+ public void method()
+ {
+
+ }
+
+ public void defaultMethod()
+ {
+
+ }
+}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/iPOJO.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/iPOJO.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/iPOJO.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/iPOJO.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public interface iPOJO
+{
+ public int method(int i);
+ public void method();
+ public void defaultMethod();
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,43 +0,0 @@
-/*
-* 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 AnnotationOverridePropertyReplacementAopTestCase extends AnnotationOverridePropertyReplacementTest
-{
- public static Test suite()
- {
- return suite(AnnotationOverridePropertyReplacementAopTestCase.class);
- }
-
- public AnnotationOverridePropertyReplacementAopTestCase(String test)
- {
- super(test);
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,43 @@
+/*
+* 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 AnnotationOverridePropertyReplacementAopTestCase extends AnnotationOverridePropertyReplacementTest
+{
+ public static Test suite()
+ {
+ return suite(AnnotationOverridePropertyReplacementAopTestCase.class);
+ }
+
+ public AnnotationOverridePropertyReplacementAopTestCase(String test)
+ {
+ super(test);
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,43 +0,0 @@
-/*
-* 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 AnnotationOverridePropertyReplacementBeansTestCase extends AnnotationOverridePropertyReplacementTest
-{
- public static Test suite()
- {
- return suite(AnnotationOverridePropertyReplacementBeansTestCase.class);
- }
-
- public AnnotationOverridePropertyReplacementBeansTestCase(String test)
- {
- super(test);
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,43 @@
+/*
+* 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 AnnotationOverridePropertyReplacementBeansTestCase extends AnnotationOverridePropertyReplacementTest
+{
+ public static Test suite()
+ {
+ return suite(AnnotationOverridePropertyReplacementBeansTestCase.class);
+ }
+
+ public AnnotationOverridePropertyReplacementBeansTestCase(String test)
+ {
+ super(test);
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,43 +0,0 @@
-/*
-* 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 AnnotationOverridePropertyReplacementDeploymentTestCase extends AnnotationOverridePropertyReplacementTest
-{
- public static Test suite()
- {
- return suite(AnnotationOverridePropertyReplacementDeploymentTestCase.class);
- }
-
- public AnnotationOverridePropertyReplacementDeploymentTestCase(String test)
- {
- super(test);
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,43 @@
+/*
+* 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 AnnotationOverridePropertyReplacementDeploymentTestCase extends AnnotationOverridePropertyReplacementTest
+{
+ public static Test suite()
+ {
+ return suite(AnnotationOverridePropertyReplacementDeploymentTestCase.class);
+ }
+
+ public AnnotationOverridePropertyReplacementDeploymentTestCase(String test)
+ {
+ super(test);
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementTest.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementTest.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementTest.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,64 +0,0 @@
-/*
-* 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 org.jboss.test.AbstractTestDelegate;
-import org.jboss.test.aop.junit.AOPMicrocontainerTest;
-import org.jboss.test.aop.junit.AOPMicrocontainerTestDelegate;
-import org.jboss.test.microcontainer.beans.AnnotationWithValueAspect;
-import org.jboss.test.microcontainer.beans.POJO;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class AnnotationOverridePropertyReplacementTest extends AOPMicrocontainerTest
-{
- public AnnotationOverridePropertyReplacementTest(String name)
- {
- // FIXME AnnotationOverridePropertyReplacementTest constructor
- super(name);
- }
-
- public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
- {
- //Run this test without security since we need to set system properties
- System.setProperty("integer", "100");
- AOPMicrocontainerTestDelegate delegate = new AOPMicrocontainerTestDelegate(clazz);
- return delegate;
- }
-
- public void testPropertyReplacement()
- {
- AnnotationWithValueAspect.value = null;
- POJO pojo = (POJO)getBean("Bean");
- pojo.method(2);
- assertNull(AnnotationWithValueAspect.value);
-
- pojo.method();
- assertNotNull(AnnotationWithValueAspect.value);
- assertEquals(100, AnnotationWithValueAspect.value.integer());
- }
-
-
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementTest.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementTest.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementTest.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementTest.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,64 @@
+/*
+* 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 org.jboss.test.AbstractTestDelegate;
+import org.jboss.test.aop.junit.AOPMicrocontainerTest;
+import org.jboss.test.aop.junit.AOPMicrocontainerTestDelegate;
+import org.jboss.test.microcontainer.beans.AnnotationWithValueAspect;
+import org.jboss.test.microcontainer.beans.POJO;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnnotationOverridePropertyReplacementTest extends AOPMicrocontainerTest
+{
+ public AnnotationOverridePropertyReplacementTest(String name)
+ {
+ // FIXME AnnotationOverridePropertyReplacementTest constructor
+ super(name);
+ }
+
+ public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
+ {
+ //Run this test without security since we need to set system properties
+ System.setProperty("integer", "100");
+ AOPMicrocontainerTestDelegate delegate = new AOPMicrocontainerTestDelegate(clazz);
+ return delegate;
+ }
+
+ public void testPropertyReplacement()
+ {
+ AnnotationWithValueAspect.value = null;
+ POJO pojo = (POJO)getBean("Bean");
+ pojo.method(2);
+ assertNull(AnnotationWithValueAspect.value);
+
+ pojo.method();
+ assertNotNull(AnnotationWithValueAspect.value);
+ assertEquals(100, AnnotationWithValueAspect.value.integer());
+ }
+
+
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,55 +0,0 @@
-/*
-* 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 AspectFactoryWithDependencyAopTestCase extends AspectFactoryWithDependencyTest
-{
- public static Test suite()
- {
- return suite(AspectFactoryWithDependencyAopTestCase.class);
- }
-
- public AspectFactoryWithDependencyAopTestCase(String test)
- {
- super(test);
- }
-
- @Override
- protected String getFile0()
- {
- return "AspectFactoryWithDependencyAopTestCaseNotAutomatic0.xml";
- }
-
- @Override
- protected String getFile1()
- {
- return "AspectFactoryWithDependencyAopTestCaseNotAutomatic1.xml";
- }
-
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,55 @@
+/*
+* 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 AspectFactoryWithDependencyAopTestCase extends AspectFactoryWithDependencyTest
+{
+ public static Test suite()
+ {
+ return suite(AspectFactoryWithDependencyAopTestCase.class);
+ }
+
+ public AspectFactoryWithDependencyAopTestCase(String test)
+ {
+ super(test);
+ }
+
+ @Override
+ protected String getFile0()
+ {
+ return "AspectFactoryWithDependencyAopTestCaseNotAutomatic0.xml";
+ }
+
+ @Override
+ protected String getFile1()
+ {
+ return "AspectFactoryWithDependencyAopTestCaseNotAutomatic1.xml";
+ }
+
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,54 +0,0 @@
-/*
-* 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 AspectFactoryWithDependencyBeansTestCase extends AspectFactoryWithDependencyTest
-{
- public static Test suite()
- {
- return suite(AspectFactoryWithDependencyBeansTestCase.class);
- }
-
- public AspectFactoryWithDependencyBeansTestCase(String test)
- {
- super(test);
- }
-
- @Override
- protected String getFile0()
- {
- return "AspectFactoryWithDependencyBeansTestCaseNotAutomatic0.xml";
- }
-
- @Override
- protected String getFile1()
- {
- return "AspectFactoryWithDependencyBeansTestCaseNotAutomatic1.xml";
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,54 @@
+/*
+* 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 AspectFactoryWithDependencyBeansTestCase extends AspectFactoryWithDependencyTest
+{
+ public static Test suite()
+ {
+ return suite(AspectFactoryWithDependencyBeansTestCase.class);
+ }
+
+ public AspectFactoryWithDependencyBeansTestCase(String test)
+ {
+ super(test);
+ }
+
+ @Override
+ protected String getFile0()
+ {
+ return "AspectFactoryWithDependencyBeansTestCaseNotAutomatic0.xml";
+ }
+
+ @Override
+ protected String getFile1()
+ {
+ return "AspectFactoryWithDependencyBeansTestCaseNotAutomatic1.xml";
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,55 +0,0 @@
-/*
-* 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 AspectFactoryWithDependencyDeploymentTestCase extends AspectFactoryWithDependencyTest
-{
- public static Test suite()
- {
- return suite(AspectFactoryWithDependencyDeploymentTestCase.class);
- }
-
- public AspectFactoryWithDependencyDeploymentTestCase(String test)
- {
- super(test);
- }
-
- @Override
- protected String getFile0()
- {
- return "AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic0.xml";
- }
-
- @Override
- protected String getFile1()
- {
- return "AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic1.xml";
- }
-
-}
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,55 @@
+/*
+* 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 AspectFactoryWithDependencyDeploymentTestCase extends AspectFactoryWithDependencyTest
+{
+ public static Test suite()
+ {
+ return suite(AspectFactoryWithDependencyDeploymentTestCase.class);
+ }
+
+ public AspectFactoryWithDependencyDeploymentTestCase(String test)
+ {
+ super(test);
+ }
+
+ @Override
+ protected String getFile0()
+ {
+ return "AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic0.xml";
+ }
+
+ @Override
+ protected String getFile1()
+ {
+ return "AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic1.xml";
+ }
+
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,91 +0,0 @@
-/*
-* 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 org.jboss.test.aop.junit.AOPMicrocontainerTest;
-import org.jboss.test.microcontainer.beans.DependencyFactoryAspect;
-import org.jboss.test.microcontainer.beans.POJO;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AspectFactoryWithDependencyTest extends AOPMicrocontainerTest
-{
-
- public AspectFactoryWithDependencyTest(String name)
- {
- super(name);
- }
-
- public void testIntercepted() throws Exception
- {
- try
- {
- deploy(getFile0());
-
- assertCannotFindBean("Bean");
- assertCannotFindBean("Dependency");
-
- try
- {
- deploy(getFile1());
-
- POJO dependency = (POJO)getBean("Dependency");
- DependencyFactoryAspect.invoked = null;
- POJO pojo = (POJO)getBean("Bean");
- int ret = pojo.method(2);
- assertEquals(4, ret);
- POJO dep = (POJO)getBean("Dependency");
- assertSame(dep, DependencyFactoryAspect.invoked);
- }
- finally
- {
- undeploy(getFile1());
- }
- assertCannotFindBean("Bean");
- assertCannotFindBean("Dependency");
- }
- finally
- {
- undeploy(getFile0());
- }
- }
-
- private void assertCannotFindBean(String name)
- {
- try
- {
- Object o = getBean(name);
- fail("Should not have found '" + name + "'");
- }
- catch (Exception expected)
- {
- }
- }
-
-
- protected abstract String getFile0();
-
- protected abstract String getFile1();
-}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,91 @@
+/*
+* 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 org.jboss.test.aop.junit.AOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans.DependencyFactoryAspect;
+import org.jboss.test.microcontainer.beans.POJO;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AspectFactoryWithDependencyTest extends AOPMicrocontainerTest
+{
+
+ public AspectFactoryWithDependencyTest(String name)
+ {
+ super(name);
+ }
+
+ public void testIntercepted() throws Exception
+ {
+ try
+ {
+ deploy(getFile0());
+
+ assertCannotFindBean("Bean");
+ assertCannotFindBean("Dependency");
+
+ try
+ {
+ deploy(getFile1());
+
+ POJO dependency = (POJO)getBean("Dependency");
+ DependencyFactoryAspect.invoked = null;
+ POJO pojo = (POJO)getBean("Bean");
+ int ret = pojo.method(2);
+ assertEquals(4, ret);
+ POJO dep = (POJO)getBean("Dependency");
+ assertSame(dep, DependencyFactoryAspect.invoked);
+ }
+ finally
+ {
+ undeploy(getFile1());
+ }
+ assertCannotFindBean("Bean");
+ assertCannotFindBean("Dependency");
+ }
+ finally
+ {
+ undeploy(getFile0());
+ }
+ }
+
+ private void assertCannotFindBean(String name)
+ {
+ try
+ {
+ Object o = getBean(name);
+ fail("Should not have found '" + name + "'");
+ }
+ catch (Exception expected)
+ {
+ }
+ }
+
+
+ protected abstract String getFile0();
+
+ protected abstract String getFile1();
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorSimpleIfaceDeploymentTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorSimpleIfaceDeploymentTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorSimpleIfaceDeploymentTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorSimpleIfaceDeploymentTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,43 @@
+/*
+* 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 InterceptorSimpleIfaceDeploymentTestCase extends InterceptorSimpleTest
+{
+
+ public static Test suite()
+ {
+ return suite(InterceptorSimpleIfaceDeploymentTestCase.class);
+ }
+
+ public InterceptorSimpleIfaceDeploymentTestCase(String name)
+ {
+ super(name);
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.xml
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.xml 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<aop xmlns="urn:jboss:aop-beans:1.0">
-
- <bean name="AspectManager" class="org.jboss.aop.AspectManager">
- <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
- </bean>
-
- <annotation expr="class(org.jboss.test.microcontainer.beans.POJO)" invisible="false">
- @org.jboss.test.microcontainer.beans.AnnotationWithValue(integer=${integer})
- </annotation>
-
- <aspect class="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect"/>
-
- <bind pointcut="execution(* @org.jboss.test.microcontainer.beans.AnnotationWithValue->*())">
- <advice aspect="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect" name="advice"/>
- </bind>
-
- <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
-
-</aop>
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.xml (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<aop xmlns="urn:jboss:aop-beans:1.0">
+
+ <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+ <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+ </bean>
+
+ <annotation expr="class(org.jboss.test.microcontainer.beans.POJO)" invisible="false">
+ @org.jboss.test.microcontainer.beans.AnnotationWithValue(integer=${integer})
+ </annotation>
+
+ <aspect class="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect"/>
+
+ <bind pointcut="execution(* @org.jboss.test.microcontainer.beans.AnnotationWithValue->*())">
+ <advice aspect="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect" name="advice"/>
+ </bind>
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
+
+</aop>
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.xml
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.xml 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,41 +0,0 @@
-<?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>
-
- <bean name="ClassAnnotationOverride" class="org.jboss.aop.microcontainer.beans.AnnotationOverride">
- <property name="manager"><inject bean="AspectManager"/></property>
- <property name="expr">class(org.jboss.test.microcontainer.beans.POJO)</property>
- <property name="annotation">@org.jboss.test.microcontainer.beans.AnnotationWithValue(integer=${integer})</property>
- <property name="invisible">false</property>
- </bean>
-
- <beanfactory name="Factory$org.jboss.test.microcontainer.beans.AnnotationWithValueAspect" class="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect"/>
-
- <bean name="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect" class="org.jboss.aop.microcontainer.beans.Aspect">
- <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans.AnnotationWithValueAspect"/></property>
- <property name="manager"><inject bean="AspectManager"/></property>
- <property name="name">org.jboss.test.microcontainer.beans.AnnotationWithValueAspect</property>
- </bean>
-
- <bean name="AnnotationWithValueAspectBinding" class="org.jboss.aop.microcontainer.beans.AspectBinding">
- <property name="pointcut">execution(* @org.jboss.test.microcontainer.beans.AnnotationWithValue->*())</property>
- <property name="manager"><inject bean="AspectManager"/></property>
- <property name="advices">
- <list>
- <bean name="AnnotationWithValueAspectBinding$1" class="org.jboss.aop.microcontainer.beans.InterceptorEntry">
- <property name="manager"><inject bean="AspectManager"/></property>
- <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect"/></property>
- <property name="aspectMethod">advice</property>
- <property name="binding"><inject bean="AnnotationWithValueAspectBinding" state="Instantiated"/></property>
- </bean>
- </list>
- </property>
- </bean>
-
- <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
-
-</deployment>
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.xml (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,41 @@
+<?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>
+
+ <bean name="ClassAnnotationOverride" class="org.jboss.aop.microcontainer.beans.AnnotationOverride">
+ <property name="manager"><inject bean="AspectManager"/></property>
+ <property name="expr">class(org.jboss.test.microcontainer.beans.POJO)</property>
+ <property name="annotation">@org.jboss.test.microcontainer.beans.AnnotationWithValue(integer=${integer})</property>
+ <property name="invisible">false</property>
+ </bean>
+
+ <beanfactory name="Factory$org.jboss.test.microcontainer.beans.AnnotationWithValueAspect" class="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect"/>
+
+ <bean name="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect" class="org.jboss.aop.microcontainer.beans.Aspect">
+ <property name="advice"><inject bean="Factory$org.jboss.test.microcontainer.beans.AnnotationWithValueAspect"/></property>
+ <property name="manager"><inject bean="AspectManager"/></property>
+ <property name="name">org.jboss.test.microcontainer.beans.AnnotationWithValueAspect</property>
+ </bean>
+
+ <bean name="AnnotationWithValueAspectBinding" class="org.jboss.aop.microcontainer.beans.AspectBinding">
+ <property name="pointcut">execution(* @org.jboss.test.microcontainer.beans.AnnotationWithValue->*())</property>
+ <property name="manager"><inject bean="AspectManager"/></property>
+ <property name="advices">
+ <list>
+ <bean name="AnnotationWithValueAspectBinding$1" class="org.jboss.aop.microcontainer.beans.InterceptorEntry">
+ <property name="manager"><inject bean="AspectManager"/></property>
+ <property name="aspect"><inject bean="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect"/></property>
+ <property name="aspectMethod">advice</property>
+ <property name="binding"><inject bean="AnnotationWithValueAspectBinding" state="Instantiated"/></property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
+
+</deployment>
Deleted: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.xml
===================================================================
--- projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.xml 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,21 +0,0 @@
-<?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>
-
- <annotation xmlns="urn:jboss:aop-beans:1.0" expr="class(org.jboss.test.microcontainer.beans.POJO)" invisible="false">
- @org.jboss.test.microcontainer.beans.AnnotationWithValue(integer=${integer})
- </annotation>
-
- <aspect xmlns="urn:jboss:aop-beans:1.0" class="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect"/>
-
- <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* @org.jboss.test.microcontainer.beans.AnnotationWithValue->*())">
- <advice aspect="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect" name="advice"/>
- </bind>
-
- <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
-
-</deployment>
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.xml (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,21 @@
+<?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>
+
+ <annotation xmlns="urn:jboss:aop-beans:1.0" expr="class(org.jboss.test.microcontainer.beans.POJO)" invisible="false">
+ @org.jboss.test.microcontainer.beans.AnnotationWithValue(integer=${integer})
+ </annotation>
+
+ <aspect xmlns="urn:jboss:aop-beans:1.0" class="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect"/>
+
+ <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* @org.jboss.test.microcontainer.beans.AnnotationWithValue->*())">
+ <advice aspect="org.jboss.test.microcontainer.beans.AnnotationWithValueAspect" name="advice"/>
+ </bind>
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
+
+</deployment>
Copied: projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorSimpleIfaceDeploymentTestCase.xml (from rev 83467, projects/microcontainer/branches/Branch_2_0/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorSimpleIfaceDeploymentTestCase.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorSimpleIfaceDeploymentTestCase.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorSimpleIfaceDeploymentTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,17 @@
+<?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>
+
+ <interceptor xmlns="urn:jboss:aop-beans:1.0" class="org.jboss.test.microcontainer.beans.TestInterceptor"/>
+
+ <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* $instanceof{org.jboss.test.microcontainer.beans.iPOJO}->$implements{org.jboss.test.microcontainer.beans.iPOJO}(..))">
+ <interceptor-ref name="org.jboss.test.microcontainer.beans.TestInterceptor"/>
+ </bind>
+
+ <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
+
+</deployment>
Deleted: projects/microcontainer/tags/2.0.3.GA/build/pom.xml
===================================================================
--- projects/microcontainer/branches/Branch_2_0/build/pom.xml 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/build/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- This pom functions as a default configuration. The subproject
- poms each inherit configuration from this one.
-
- When adding version information for an artifact please do the following
- - add a version property for the specific version
- - add a dependency in the dependencyManagement section which refers to
- the property
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-microcontainer</artifactId>
- <version>2.0.3-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-microcontainer-dist</artifactId>
- <version>2.0.3-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>JBoss Microcontainer Distribution Build</name>
- <description>
- The JBoss Microcontainer provides a lightweight container for managing POJOs, their deployment
- and configuration.
- </description>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-2</version>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- <configuration>
- <finalName>jboss-microcontainer-${project.version}</finalName>
- <descriptors>
- <descriptor>src/assembly/dist.xml</descriptor>
- <descriptor>src/assembly/dist-with-deps.xml</descriptor>
- <descriptor>src/assembly/src.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-aop-mc-int</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-guice-int</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-spring-int</artifactId>
- </dependency>
-
- </dependencies>
-
-</project>
Copied: projects/microcontainer/tags/2.0.3.GA/build/pom.xml (from rev 83478, projects/microcontainer/branches/Branch_2_0/build/pom.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/build/pom.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/build/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This pom functions as a default configuration. The subproject
+ poms each inherit configuration from this one.
+
+ When adding version information for an artifact please do the following
+ - add a version property for the specific version
+ - add a dependency in the dependencyManagement section which refers to
+ the property
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-microcontainer</artifactId>
+ <version>2.0.3.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-microcontainer-dist</artifactId>
+ <version>2.0.3.GA</version>
+ <packaging>pom</packaging>
+ <name>JBoss Microcontainer Distribution Build</name>
+ <description>
+ The JBoss Microcontainer provides a lightweight container for managing POJOs, their deployment
+ and configuration.
+ </description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2</version>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ <configuration>
+ <finalName>jboss-microcontainer-${project.version}</finalName>
+ <descriptors>
+ <descriptor>src/assembly/dist.xml</descriptor>
+ <descriptor>src/assembly/dist-with-deps.xml</descriptor>
+ <descriptor>src/assembly/src.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-aop-mc-int</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-guice-int</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-spring-int</artifactId>
+ </dependency>
+
+ </dependencies>
+
+</project>
Deleted: projects/microcontainer/tags/2.0.3.GA/dependency/pom.xml
===================================================================
--- projects/microcontainer/branches/Branch_2_0/dependency/pom.xml 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/dependency/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,84 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-microcontainer</artifactId>
- <version>2.0.3-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-dependency</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Microcontainer Dependency</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Microcontainer Dependency</description>
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/microcontainer/branches/Branch_2_0/dependency</connection>
- <developerConnection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/microcontainer/branches/Branch_2_0/dependency</developerConnection>
- <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/microcontainer/branches/Branch_2_0/dependency</url>
- </scm>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/spi.xml</descriptor>
- <descriptor>src/assembly/plugins.xml</descriptor>
- </descriptors>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/AbstractDependencyTest*</exclude>
- <exclude>**/TestControllerContext*</exclude>
- <exclude>**/TestDelegate*</exclude>
- </excludes>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <!-- Do not add version information here, use ../pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-reflect</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-mdr</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </dependency>
- <!-- Test dependencies -->
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test</groupId>
- <artifactId>jboss-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
Copied: projects/microcontainer/tags/2.0.3.GA/dependency/pom.xml (from rev 83478, projects/microcontainer/branches/Branch_2_0/dependency/pom.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/dependency/pom.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/dependency/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,84 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-microcontainer</artifactId>
+ <version>2.0.3.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-dependency</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Microcontainer Dependency</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Microcontainer Dependency</description>
+ <scm>
+ <connection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/microcontainer/tags/2.0.3.GAdependency</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/microcontainer/tags/2.0.3.GAdependency</developerConnection>
+ <url>scm:svn:https://svn.jboss.org/repos/jbossas/projects/microcontainer/tags/2.0.3.GAdependency</url>
+ </scm>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/spi.xml</descriptor>
+ <descriptor>src/assembly/plugins.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/AbstractDependencyTest*</exclude>
+ <exclude>**/TestControllerContext*</exclude>
+ <exclude>**/TestDelegate*</exclude>
+ </excludes>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- Do not add version information here, use ../pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test</groupId>
+ <artifactId>jboss-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Deleted: projects/microcontainer/tags/2.0.3.GA/guice-int/pom.xml
===================================================================
--- projects/microcontainer/branches/Branch_2_0/guice-int/pom.xml 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/guice-int/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,47 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-microcontainer</artifactId>
- <version>2.0.3-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-guice-int</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Microcontainer Guice Int</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Microcontainer Guice Int</description>
-
- <!-- Do not add version information here, use ../pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>com.google.code.guice</groupId>
- <artifactId>guice</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-managed</artifactId>
- <optional>true</optional>
- </dependency>
- <!-- Test dependencies -->
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test</groupId>
- <artifactId>jboss-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
Copied: projects/microcontainer/tags/2.0.3.GA/guice-int/pom.xml (from rev 83478, projects/microcontainer/branches/Branch_2_0/guice-int/pom.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/guice-int/pom.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/guice-int/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,47 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-microcontainer</artifactId>
+ <version>2.0.3.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-guice-int</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Microcontainer Guice Int</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Microcontainer Guice Int</description>
+
+ <!-- Do not add version information here, use ../pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>com.google.code.guice</groupId>
+ <artifactId>guice</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test</groupId>
+ <artifactId>jboss-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/pom.xml
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/pom.xml 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,102 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-microcontainer</artifactId>
- <version>2.0.3-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-kernel</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Microcontainer Kernel</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Microcontainer Kernel</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <!--configuration>
- <testFailureIgnore>true</testFailureIgnore>
- </configuration-->
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/spi.xml</descriptor>
- <descriptor>src/assembly/plugins.xml</descriptor>
- <descriptor>src/assembly/annotations.xml</descriptor>
- </descriptors>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.jboss.test</groupId>
- <artifactId>jboss-test</artifactId>
- <version>${version.org.jboss.test}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${version.junit}</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <!-- Do not add version information here, use ../pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-managed</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.test</groupId>
- <artifactId>jboss-test</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <optional>true</optional>
- </dependency>
- <!-- Test dependencies -->
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/pom.xml (from rev 83478, projects/microcontainer/branches/Branch_2_0/kernel/pom.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/pom.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,102 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-microcontainer</artifactId>
+ <version>2.0.3.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-kernel</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Microcontainer Kernel</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Microcontainer Kernel</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <!--configuration>
+ <testFailureIgnore>true</testFailureIgnore>
+ </configuration-->
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/spi.xml</descriptor>
+ <descriptor>src/assembly/plugins.xml</descriptor>
+ <descriptor>src/assembly/annotations.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.test</groupId>
+ <artifactId>jboss-test</artifactId>
+ <version>${version.org.jboss.test}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit}</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <!-- Do not add version information here, use ../pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test</groupId>
+ <artifactId>jboss-test</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInjectionValueMetaData.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInjectionValueMetaData.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInjectionValueMetaData.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,336 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.beans.metadata.plugins;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.XmlType;
-
-import org.jboss.beans.metadata.api.model.AutowireType;
-import org.jboss.beans.metadata.api.model.FromContext;
-import org.jboss.beans.metadata.api.model.InjectOption;
-import org.jboss.beans.metadata.spi.MetaDataVisitor;
-import org.jboss.beans.metadata.spi.MetaDataVisitorNode;
-import org.jboss.dependency.plugins.AttributeCallbackItem;
-import org.jboss.dependency.spi.Controller;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.dependency.spi.DependencyItem;
-import org.jboss.kernel.plugins.dependency.ClassContextDependencyItem;
-import org.jboss.reflect.spi.TypeInfo;
-import org.jboss.util.JBossStringBuilder;
-
-/**
- * Injection value.
- *
- * @author <a href="ales.justin at gmail.com">Ales Justin</a>
- */
- at XmlType
-public class AbstractInjectionValueMetaData extends AbstractDependencyValueMetaData
-{
- private static final long serialVersionUID = 3L;
-
- protected AutowireType injectionType = AutowireType.BY_CLASS;
-
- protected InjectOption injectionOption = InjectOption.STRICT;
-
- protected FromContext fromContext;
-
- /**
- * Simplyifies things with AutowireType.BY_NAME
- */
- protected AbstractPropertyMetaData propertyMetaData;
-
- /**
- * Create a new injection value
- */
- public AbstractInjectionValueMetaData()
- {
- }
-
- /**
- * Create a new injection value
- *
- * @param value the value
- */
- public AbstractInjectionValueMetaData(Object value)
- {
- super(value);
- }
-
- /**
- * Create a new injection value
- *
- * @param value the value
- * @param property the property
- */
- public AbstractInjectionValueMetaData(Object value, String property)
- {
- super(value, property);
- }
-
- public AutowireType getInjectionType()
- {
- return injectionType;
- }
-
- @XmlAttribute(name="type")
- public void setInjectionType(AutowireType injectionType)
- {
- this.injectionType = injectionType;
- }
-
- public InjectOption getInjectionOption()
- {
- return injectionOption;
- }
-
- @XmlAttribute(name="option")
- public void setInjectionOption(InjectOption injectionOption)
- {
- this.injectionOption = injectionOption;
- }
-
- public FromContext getFromContext()
- {
- return fromContext;
- }
-
- @XmlAttribute(name="fromContext")
- public void setFromContext(FromContext fromContext)
- {
- this.fromContext = fromContext;
- }
-
- public AbstractPropertyMetaData getPropertyMetaData()
- {
- return propertyMetaData;
- }
-
- @XmlTransient
- public void setPropertyMetaData(AbstractPropertyMetaData propertyMetaData)
- {
- this.propertyMetaData = propertyMetaData;
- }
-
- protected void addInstallItem(Object name)
- {
- if (propertyMetaData == null)
- throw new IllegalArgumentException("Illegal usage of option Callback - injection not used with property = " + this);
- context.getDependencyInfo().addInstallItem(new AttributeCallbackItem<Object>(name, whenRequiredState, dependentState, context, propertyMetaData.getName()));
- }
-
- protected boolean isLookupValid(ControllerContext lookup)
- {
- boolean lookupExists = super.isLookupValid(lookup);
- boolean isCallback = InjectOption.CALLBACK.equals(injectionOption);
- boolean isOptional = InjectOption.OPTIONAL.equals(injectionOption);
- if (lookupExists == false && isCallback)
- {
- addInstallItem(getUnderlyingValue());
- }
- return lookupExists || isCallback || isOptional;
- }
-
- protected boolean isOptional()
- {
- return InjectOption.OPTIONAL.equals(injectionOption);
- }
-
- @SuppressWarnings({"unchecked", "deprecation"})
- public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
- {
- // controller context property injection
- if (fromContext != null)
- {
- ControllerState state = dependentState;
- if (state == null)
- state = ControllerState.INSTANTIATED;
- Controller controller = context.getController();
- ControllerContext lookup = controller.getContext(getUnderlyingValue(), state);
- if (lookup == null)
- throw new Error("Should not be here - dependency failed - " + this);
- return fromContext.executeLookup(lookup);
- }
-
- // by class type
- if (getUnderlyingValue() == null)
- {
- Controller controller = context.getController();
- ControllerContext lookup = controller.getInstalledContext(info.getType());
- if (lookup == null)
- {
- if (InjectOption.STRICT.equals(injectionOption))
- {
- throw new IllegalArgumentException("Possible multiple matching beans, see log for info.");
- }
- else
- {
- if (InjectOption.CALLBACK.equals(injectionOption))
- addInstallItem(info.getType());
-
- return null;
- }
- }
- // TODO - add progression here, then fix BeanMetaData as well
- return lookup.getTarget();
- }
- return super.getValue(info, cl);
- }
-
- protected boolean addDependencyItem()
- {
- return InjectOption.STRICT.equals(injectionOption) || fromContext != null;
- }
-
- public Object getUnderlyingValue()
- {
- Object original = super.getUnderlyingValue();
- // might be used for internal compare, in that case context will still be null
- return (fromContext != null && original == null) ? (context != null ? context.getName() : null) : original;
- }
-
- public void initialVisit(MetaDataVisitor visitor)
- {
- // controller context property injection
- if (fromContext != null)
- {
- // check if dependent is not set when used on itself
- if (super.getUnderlyingValue() == null && dependentState == null)
- dependentState = fromContext.getWhenValid();
-
- super.initialVisit(visitor);
- return;
- }
-
- // no bean specified
- if (getUnderlyingValue() == null)
- {
- // check for property
- if (property != null)
- {
- property = null;
- log.warn("Ignoring property - contextual injection: " + this);
- }
-
- if (AutowireType.BY_NAME.equals(injectionType))
- {
- if (propertyMetaData == null)
- throw new IllegalArgumentException("Illegal usage of type ByName - injection not used with property = " + this);
- setValue(propertyMetaData.getName());
- }
- else
- {
- visitor.initialVisit(this);
- }
- }
- // check if was maybe set with by_name
- if (getUnderlyingValue() != null)
- {
- super.initialVisit(visitor);
- }
- }
-
- @SuppressWarnings("deprecation")
- public void describeVisit(MetaDataVisitor visitor)
- {
- // no bean and not by_name
- if (getUnderlyingValue() == null)
- {
- if (AutowireType.BY_CLASS.equals(injectionType))
- {
- context = visitor.getControllerContext();
-
- // dependency item or install item
- if (InjectOption.STRICT.equals(injectionOption))
- {
- // add dependency item only for strict inject behaviour
- // we pop it so that parent node has the same semantics as this one
- // meaning that his current peek is also his parent
- // and all other nodes that cannot determine type follow the same
- // contract - popping and pushing
- // maybe the whole thing can be rewritten to LinkedList
- // or simply using the fact that Stack is also a Vector?
- MetaDataVisitorNode node = visitor.visitorNodeStack().pop();
- try
- {
- if (node instanceof TypeProvider)
- {
- TypeProvider typeProvider = (TypeProvider)node;
- Class<?> injectionClass = typeProvider.getType(visitor, this).getType();
- log.debug(context.getName() + ": Contextual injection usage (class -> classloader): " + injectionClass + " -> " + injectionClass.getClassLoader() + " defined by " + node);
- // set when required
- ControllerState whenRequired = whenRequiredState;
- if (whenRequired == null)
- {
- whenRequired = visitor.getContextState();
- }
- DependencyItem item = new ClassContextDependencyItem(
- context.getName(),
- injectionClass,
- whenRequired,
- dependentState);
- visitor.addDependency(item);
- }
- else
- {
- throw new Error(TypeProvider.ERROR_MSG);
- }
- }
- catch (Error error)
- {
- throw error;
- }
- catch (Throwable throwable)
- {
- throw new Error(throwable);
- }
- finally
- {
- visitor.visitorNodeStack().push(node);
- }
- }
- }
- else
- {
- throw new IllegalArgumentException("Unknown injection type=" + injectionType);
- }
- }
- super.describeVisit(visitor);
- }
-
- public void toString(JBossStringBuilder buffer)
- {
- super.toString(buffer);
- if (injectionType != null)
- buffer.append(" injectionType=").append(injectionType);
- if (propertyMetaData != null)
- buffer.append(" propertyMetaData=").append(propertyMetaData.getName()); //else overflow - indefinite recursion
- if (fromContext != null)
- buffer.append(" fromContext=").append(fromContext);
- }
-
- public AbstractInjectionValueMetaData clone()
- {
- return (AbstractInjectionValueMetaData)super.clone();
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInjectionValueMetaData.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInjectionValueMetaData.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInjectionValueMetaData.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInjectionValueMetaData.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,336 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, 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.beans.metadata.plugins;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.beans.metadata.api.model.AutowireType;
+import org.jboss.beans.metadata.api.model.FromContext;
+import org.jboss.beans.metadata.api.model.InjectOption;
+import org.jboss.beans.metadata.spi.MetaDataVisitor;
+import org.jboss.beans.metadata.spi.MetaDataVisitorNode;
+import org.jboss.dependency.plugins.AttributeCallbackItem;
+import org.jboss.dependency.spi.Controller;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.kernel.plugins.dependency.ClassContextDependencyItem;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.util.JBossStringBuilder;
+
+/**
+ * Injection value.
+ *
+ * @author <a href="ales.justin at gmail.com">Ales Justin</a>
+ */
+ at XmlType
+public class AbstractInjectionValueMetaData extends AbstractDependencyValueMetaData
+{
+ private static final long serialVersionUID = 3L;
+
+ protected AutowireType injectionType = AutowireType.BY_CLASS;
+
+ protected InjectOption injectionOption = InjectOption.STRICT;
+
+ protected FromContext fromContext;
+
+ /**
+ * Simplyifies things with AutowireType.BY_NAME
+ */
+ protected AbstractPropertyMetaData propertyMetaData;
+
+ /**
+ * Create a new injection value
+ */
+ public AbstractInjectionValueMetaData()
+ {
+ }
+
+ /**
+ * Create a new injection value
+ *
+ * @param value the value
+ */
+ public AbstractInjectionValueMetaData(Object value)
+ {
+ super(value);
+ }
+
+ /**
+ * Create a new injection value
+ *
+ * @param value the value
+ * @param property the property
+ */
+ public AbstractInjectionValueMetaData(Object value, String property)
+ {
+ super(value, property);
+ }
+
+ public AutowireType getInjectionType()
+ {
+ return injectionType;
+ }
+
+ @XmlAttribute(name="type")
+ public void setInjectionType(AutowireType injectionType)
+ {
+ this.injectionType = injectionType;
+ }
+
+ public InjectOption getInjectionOption()
+ {
+ return injectionOption;
+ }
+
+ @XmlAttribute(name="option")
+ public void setInjectionOption(InjectOption injectionOption)
+ {
+ this.injectionOption = injectionOption;
+ }
+
+ public FromContext getFromContext()
+ {
+ return fromContext;
+ }
+
+ @XmlAttribute(name="fromContext")
+ public void setFromContext(FromContext fromContext)
+ {
+ this.fromContext = fromContext;
+ }
+
+ public AbstractPropertyMetaData getPropertyMetaData()
+ {
+ return propertyMetaData;
+ }
+
+ @XmlTransient
+ public void setPropertyMetaData(AbstractPropertyMetaData propertyMetaData)
+ {
+ this.propertyMetaData = propertyMetaData;
+ }
+
+ protected void addInstallItem(Object name)
+ {
+ if (propertyMetaData == null)
+ throw new IllegalArgumentException("Illegal usage of option Callback - injection not used with property = " + this);
+ context.getDependencyInfo().addInstallItem(new AttributeCallbackItem<Object>(name, whenRequiredState, dependentState, context, propertyMetaData.getName()));
+ }
+
+ protected boolean isLookupValid(ControllerContext lookup)
+ {
+ boolean lookupExists = super.isLookupValid(lookup);
+ boolean isCallback = InjectOption.CALLBACK.equals(injectionOption);
+ boolean isOptional = InjectOption.OPTIONAL.equals(injectionOption);
+ if (lookupExists == false && isCallback)
+ {
+ addInstallItem(getUnderlyingValue());
+ }
+ return lookupExists || isCallback || isOptional;
+ }
+
+ protected boolean isOptional()
+ {
+ return InjectOption.OPTIONAL.equals(injectionOption);
+ }
+
+ @SuppressWarnings({"unchecked", "deprecation"})
+ public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
+ {
+ // controller context property injection
+ if (fromContext != null)
+ {
+ ControllerState state = dependentState;
+ if (state == null)
+ state = ControllerState.INSTANTIATED;
+ Controller controller = context.getController();
+ ControllerContext lookup = controller.getContext(getUnderlyingValue(), state);
+ if (lookup == null)
+ throw new Error("Should not be here - dependency failed - " + this);
+ return fromContext.executeLookup(lookup);
+ }
+
+ // by class type
+ if (getUnderlyingValue() == null)
+ {
+ Controller controller = context.getController();
+ ControllerContext lookup = controller.getInstalledContext(info.getType());
+ if (lookup == null)
+ {
+ if (InjectOption.STRICT.equals(injectionOption))
+ {
+ throw new IllegalArgumentException("Possible multiple matching beans, see log for info.");
+ }
+ else
+ {
+ if (InjectOption.CALLBACK.equals(injectionOption))
+ addInstallItem(info.getType());
+
+ return null;
+ }
+ }
+ // TODO - add progression here, then fix BeanMetaData as well
+ return lookup.getTarget();
+ }
+ return super.getValue(info, cl);
+ }
+
+ protected boolean addDependencyItem()
+ {
+ return InjectOption.STRICT.equals(injectionOption) || fromContext != null;
+ }
+
+ public Object getUnderlyingValue()
+ {
+ Object original = super.getUnderlyingValue();
+ // might be used for internal compare, in that case context will still be null
+ return (fromContext != null && original == null) ? (context != null ? context.getName() : null) : original;
+ }
+
+ public void initialVisit(MetaDataVisitor visitor)
+ {
+ // controller context property injection
+ if (fromContext != null)
+ {
+ // check if dependent is not set when used on itself
+ if (super.getUnderlyingValue() == null && dependentState == null)
+ dependentState = fromContext.getWhenValid();
+
+ super.initialVisit(visitor);
+ return;
+ }
+
+ // no bean specified
+ if (getUnderlyingValue() == null)
+ {
+ // check for property
+ if (property != null)
+ {
+ property = null;
+ log.warn("Ignoring property - contextual injection: " + this);
+ }
+
+ if (AutowireType.BY_NAME.equals(injectionType))
+ {
+ if (propertyMetaData == null)
+ throw new IllegalArgumentException("Illegal usage of type ByName - injection not used with property = " + this);
+ setValue(propertyMetaData.getName());
+ }
+ else
+ {
+ visitor.initialVisit(this);
+ }
+ }
+ // check if was maybe set with by_name
+ if (getUnderlyingValue() != null)
+ {
+ super.initialVisit(visitor);
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ public void describeVisit(MetaDataVisitor visitor)
+ {
+ // no bean and not by_name
+ if (getUnderlyingValue() == null)
+ {
+ if (AutowireType.BY_CLASS.equals(injectionType))
+ {
+ context = visitor.getControllerContext();
+
+ // dependency item or install item
+ if (InjectOption.STRICT.equals(injectionOption))
+ {
+ // add dependency item only for strict inject behaviour
+ // we pop it so that parent node has the same semantics as this one
+ // meaning that his current peek is also his parent
+ // and all other nodes that cannot determine type follow the same
+ // contract - popping and pushing
+ // maybe the whole thing can be rewritten to LinkedList
+ // or simply using the fact that Stack is also a Vector?
+ MetaDataVisitorNode node = visitor.visitorNodeStack().pop();
+ try
+ {
+ if (node instanceof TypeProvider)
+ {
+ TypeProvider typeProvider = (TypeProvider)node;
+ Class<?> injectionClass = typeProvider.getType(visitor, this).getType();
+ log.debug(context.getName() + ": Contextual injection usage (class -> classloader): " + injectionClass + " -> " + SecurityActions.getClassLoader(injectionClass) + " defined by " + node);
+ // set when required
+ ControllerState whenRequired = whenRequiredState;
+ if (whenRequired == null)
+ {
+ whenRequired = visitor.getContextState();
+ }
+ DependencyItem item = new ClassContextDependencyItem(
+ context.getName(),
+ injectionClass,
+ whenRequired,
+ dependentState);
+ visitor.addDependency(item);
+ }
+ else
+ {
+ throw new Error(TypeProvider.ERROR_MSG);
+ }
+ }
+ catch (Error error)
+ {
+ throw error;
+ }
+ catch (Throwable throwable)
+ {
+ throw new Error(throwable);
+ }
+ finally
+ {
+ visitor.visitorNodeStack().push(node);
+ }
+ }
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unknown injection type=" + injectionType);
+ }
+ }
+ super.describeVisit(visitor);
+ }
+
+ public void toString(JBossStringBuilder buffer)
+ {
+ super.toString(buffer);
+ if (injectionType != null)
+ buffer.append(" injectionType=").append(injectionType);
+ if (propertyMetaData != null)
+ buffer.append(" propertyMetaData=").append(propertyMetaData.getName()); //else overflow - indefinite recursion
+ if (fromContext != null)
+ buffer.append(" fromContext=").append(fromContext);
+ }
+
+ public AbstractInjectionValueMetaData clone()
+ {
+ return (AbstractInjectionValueMetaData)super.clone();
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/SecurityActions.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/main/java/org/jboss/beans/metadata/plugins/SecurityActions.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/SecurityActions.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,101 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2007, 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.beans.metadata.plugins;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * SecurityActions.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-class SecurityActions
-{
- static ClassLoader setContextClassLoader(final ClassLoader cl) throws Throwable
- {
- if (System.getSecurityManager() == null)
- {
- ClassLoader result = Thread.currentThread().getContextClassLoader();
- if (cl != null)
- Thread.currentThread().setContextClassLoader(cl);
- return result;
- }
- else
- {
- try
- {
- return AccessController.doPrivileged(new PrivilegedExceptionAction<ClassLoader>()
- {
- public ClassLoader run() throws Exception
- {
- try
- {
- ClassLoader result = Thread.currentThread().getContextClassLoader();
- if (cl != null)
- Thread.currentThread().setContextClassLoader(cl);
- return result;
- }
- catch (Exception e)
- {
- throw e;
- }
- catch (Error e)
- {
- throw e;
- }
- catch (Throwable e)
- {
- throw new RuntimeException("Error setting context classloader", e);
- }
- }
- });
- }
- catch (PrivilegedActionException e)
- {
- throw e.getCause();
- }
- }
- }
-
- static void resetContextClassLoader(final ClassLoader classLoader)
- {
- if (System.getSecurityManager() == null)
- {
- Thread.currentThread().setContextClassLoader(classLoader);
- }
- else
- {
- AccessController.doPrivileged(new PrivilegedAction<Object>()
- {
- public Object run()
- {
- Thread.currentThread().setContextClassLoader(classLoader);
- return null;
- }
- });
- }
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/SecurityActions.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/main/java/org/jboss/beans/metadata/plugins/SecurityActions.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/SecurityActions.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/SecurityActions.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,139 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2007, 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.beans.metadata.plugins;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+/**
+ * SecurityActions.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ * @version $Revision: 1.1 $
+ */
+class SecurityActions
+{
+ /**
+ * Set context classloader.
+ *
+ * @param cl the classloader
+ * @return previous context classloader
+ * @throws Throwable for any error
+ */
+ static ClassLoader setContextClassLoader(final ClassLoader cl) throws Throwable
+ {
+ if (System.getSecurityManager() == null)
+ {
+ ClassLoader result = Thread.currentThread().getContextClassLoader();
+ if (cl != null)
+ Thread.currentThread().setContextClassLoader(cl);
+ return result;
+ }
+ else
+ {
+ try
+ {
+ return AccessController.doPrivileged(new PrivilegedExceptionAction<ClassLoader>()
+ {
+ public ClassLoader run() throws Exception
+ {
+ try
+ {
+ ClassLoader result = Thread.currentThread().getContextClassLoader();
+ if (cl != null)
+ Thread.currentThread().setContextClassLoader(cl);
+ return result;
+ }
+ catch (Exception e)
+ {
+ throw e;
+ }
+ catch (Error e)
+ {
+ throw e;
+ }
+ catch (Throwable e)
+ {
+ throw new RuntimeException("Error setting context classloader", e);
+ }
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw e.getCause();
+ }
+ }
+ }
+
+ /**
+ * Reset context classloader.
+ *
+ * @param classLoader the classloader
+ */
+ static void resetContextClassLoader(final ClassLoader classLoader)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ }
+ else
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ return null;
+ }
+ });
+ }
+ }
+
+ /**
+ * Get classloader from class.
+ *
+ * @param clazz the class
+ * @return class's classloader
+ */
+ static ClassLoader getClassLoader(final Class<?> clazz)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return clazz.getClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return clazz.getClassLoader();
+ }
+ });
+ }
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,1061 +0,0 @@
-/*
-* 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.beans.metadata.plugins.builder;
-
-import java.lang.annotation.Annotation;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.beans.info.spi.BeanAccessMode;
-import org.jboss.beans.metadata.api.model.AutowireType;
-import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData;
-import org.jboss.beans.metadata.plugins.AbstractArrayMetaData;
-import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
-import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData;
-import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData;
-import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData;
-import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData;
-import org.jboss.beans.metadata.plugins.AbstractDemandMetaData;
-import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData;
-import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData;
-import org.jboss.beans.metadata.plugins.AbstractInstallMetaData;
-import org.jboss.beans.metadata.plugins.AbstractListMetaData;
-import org.jboss.beans.metadata.plugins.AbstractMapMetaData;
-import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
-import org.jboss.beans.metadata.plugins.AbstractRelatedClassMetaData;
-import org.jboss.beans.metadata.plugins.AbstractSetMetaData;
-import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData;
-import org.jboss.beans.metadata.plugins.AbstractValueMetaData;
-import org.jboss.beans.metadata.plugins.DirectAnnotationMetaData;
-import org.jboss.beans.metadata.plugins.StringValueMetaData;
-import org.jboss.beans.metadata.plugins.ThisValueMetaData;
-import org.jboss.beans.metadata.spi.AnnotationMetaData;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
-import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
-import org.jboss.beans.metadata.spi.DemandMetaData;
-import org.jboss.beans.metadata.spi.DependencyMetaData;
-import org.jboss.beans.metadata.spi.PropertyMetaData;
-import org.jboss.beans.metadata.spi.RelatedClassMetaData;
-import org.jboss.beans.metadata.spi.SupplyMetaData;
-import org.jboss.beans.metadata.spi.ValueMetaData;
-import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
-import org.jboss.beans.metadata.spi.builder.ParameterMetaDataBuilder;
-import org.jboss.dependency.spi.Cardinality;
-import org.jboss.dependency.spi.ControllerMode;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.dependency.spi.ErrorHandlingMode;
-
-/**
- * Helper class.
- * Similar to StringBuffer, methods return current instance of BeanMetaDataBuilder.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
- */
-class BeanMetaDataBuilderImpl extends BeanMetaDataBuilder
-{
- /** The bean metadata */
- private AbstractBeanMetaData beanMetaData;
-
- /** The constructor builder */
- private ParameterMetaDataBuilderImpl<AbstractConstructorMetaData> constructorBuilder;
-
- /** The create lifecycle builder */
- private LifecycleMetaDataBuilder createBuilder;
-
- /** The start lifecycle builder */
- private LifecycleMetaDataBuilder startBuilder;
-
- /** The stop lifecycle builder */
- private LifecycleMetaDataBuilder stopBuilder;
-
- /** The destroy lifecycle builder */
- private LifecycleMetaDataBuilder destroyBuilder;
-
- /** The install builder */
- private StateActionBuilder<AbstractInstallMetaData> installBuilder;
-
- /** The uninstall builder */
- private StateActionBuilder<AbstractInstallMetaData> uninstallBuilder;
-
- /** The incallback builder */
- private StateActionBuilder<AbstractCallbackMetaData> propIncallbackBuilder;
-
- /** The uncallback builder */
- private StateActionBuilder<AbstractCallbackMetaData> propUncallbackBuilder;
-
- /** The incallback builder */
- private StateActionBuilder<AbstractCallbackMetaData> incallbackBuilder;
-
- /** The uncallback builder */
- private StateActionBuilder<AbstractCallbackMetaData> uncallbackBuilder;
-
- /**
- * Create a new BeanMetaDataBuilderImpl.
- *
- * @param bean the bean
- */
- public BeanMetaDataBuilderImpl(String bean)
- {
- this(new AbstractBeanMetaData(bean));
- }
-
- /**
- * Create a new BeanMetaDataBuilderImpl.
- *
- * @param name the bean name
- * @param bean the bean
- */
- public BeanMetaDataBuilderImpl(String name, String bean)
- {
- this(new AbstractBeanMetaData(name, bean));
- }
-
- /**
- * Create a new BeanMetaDataBuilderImpl.
- *
- * @param beanMetaData the bean metadata
- */
- public BeanMetaDataBuilderImpl(AbstractBeanMetaData beanMetaData)
- {
- this.beanMetaData = beanMetaData;
- // lifecycle builders
- createBuilder = createCreateLifecycleMetaDataBuilder(beanMetaData);
- startBuilder = createStartLifecycleMetaDataBuilder(beanMetaData);
- stopBuilder = createStopLifecycleMetaDataBuilder(beanMetaData);
- destroyBuilder = createDestroyLifecycleMetaDataBuilder(beanMetaData);
- // install
- installBuilder = createInstallMetaDataBuilder(beanMetaData);
- uninstallBuilder = createUninstallMetaDataBuilder(beanMetaData);
- // callback
- propIncallbackBuilder = createPropertyInstallCallbackMetaDataBuilder(beanMetaData);
- propUncallbackBuilder = createPropertyUninstallCallbackMetaDataBuilder(beanMetaData);
- incallbackBuilder = createInstallCallbackMetaDataBuilder(beanMetaData);
- uncallbackBuilder = createUninstallCallbackMetaDataBuilder(beanMetaData);
- }
-
- /**
- * Create lifecycle metadata builder.
- *
- * @param beanMetaData the bean metadata
- * @return the lifecycle metadata builder
- */
- protected LifecycleMetaDataBuilder createCreateLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData)
- {
- return new CreateLifecycleMetaDataBuilder(beanMetaData);
- }
-
- /**
- * Create lifecycle metadata builder.
- *
- * @param beanMetaData the bean metadata
- * @return the lifecycle metadata builder
- */
- protected LifecycleMetaDataBuilder createStartLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData)
- {
- return new StartLifecycleMetaDataBuilder(beanMetaData);
- }
-
- /**
- * Create lifecycle metadata builder.
- *
- * @param beanMetaData the bean metadata
- * @return the lifecycle metadata builder
- */
- protected LifecycleMetaDataBuilder createStopLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData)
- {
- return new StopLifecycleMetaDataBuilder(beanMetaData);
- }
-
- /**
- * Create lifecycle metadata builder.
- *
- * @param beanMetaData the bean metadata
- * @return the lifecycle metadata builder
- */
- protected LifecycleMetaDataBuilder createDestroyLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData)
- {
- return new DestroyLifecycleMetaDataBuilder(beanMetaData);
- }
-
- /**
- * Create install metadata builder.
- *
- * @param beanMetaData the bean metadata
- * @return the install builder
- */
- protected StateActionBuilder<AbstractInstallMetaData> createInstallMetaDataBuilder(AbstractBeanMetaData beanMetaData)
- {
- return new InstallMetaDataBuilder(beanMetaData);
- }
-
- /**
- * Create install metadata builder.
- *
- * @param beanMetaData the bean metadata
- * @return the install builder
- */
- protected StateActionBuilder<AbstractInstallMetaData> createUninstallMetaDataBuilder(AbstractBeanMetaData beanMetaData)
- {
- return new UninstallMetaDataBuilder(beanMetaData);
- }
-
- /**
- * Create callback metadata builder.
- *
- * @param beanMetaData the bean metadata
- * @return the callback metadata builder
- */
- private StateActionBuilder<AbstractCallbackMetaData> createPropertyInstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData)
- {
- return new PropertyInstallCallbackMetaDataBuilder(beanMetaData);
- }
-
- /**
- * Create callback metadata builder.
- *
- * @param beanMetaData the bean metadata
- * @return the callback metadata builder
- */
- private StateActionBuilder<AbstractCallbackMetaData> createPropertyUninstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData)
- {
- return new PropertyUninstallCallbackMetaDataBuilder(beanMetaData);
- }
-
- /**
- * Create callback metadata builder.
- *
- * @param beanMetaData the bean metadata
- * @return the callback metadata builder
- */
- private StateActionBuilder<AbstractCallbackMetaData> createInstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData)
- {
- return new InstallCallbackMetaDataBuilder(beanMetaData);
- }
-
- /**
- * Create callback metadata builder.
- *
- * @param beanMetaData the bean metadata
- * @return the callback metadata builder
- */
- private StateActionBuilder<AbstractCallbackMetaData> createUninstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData)
- {
- return new UninstallCallbackMetaDataBuilder(beanMetaData);
- }
-
- public BeanMetaData getBeanMetaData()
- {
- return beanMetaData;
- }
-
- public BeanMetaDataFactory getBeanMetaDataFactory()
- {
- return beanMetaData;
- }
-
- public BeanMetaDataBuilder setName(String name)
- {
- beanMetaData.setName(name);
- return this;
- }
-
- public BeanMetaDataBuilder setBean(String bean)
- {
- beanMetaData.setBean(bean);
- return this;
- }
-
- public BeanMetaDataBuilder addRelatedClass(String className, Object... enabled)
- {
- RelatedClassMetaData related = createRelated(className, enabled);
- return addRelatedClass(related);
- }
-
- public BeanMetaDataBuilder addRelatedClass(RelatedClassMetaData related)
- {
- Set<RelatedClassMetaData> relatedSet = beanMetaData.getRelated();
- if (relatedSet == null)
- {
- relatedSet = new HashSet<RelatedClassMetaData>();
- beanMetaData.setRelated(relatedSet);
- }
- relatedSet.add(related);
- return this;
- }
-
- public BeanMetaDataBuilder setRelated(Set<RelatedClassMetaData> related)
- {
- beanMetaData.setRelated(related);
- return this;
- }
-
- public BeanMetaDataBuilder setAliases(Set<Object> aliases)
- {
- beanMetaData.setAliases(aliases);
- return this;
- }
-
- public BeanMetaDataBuilder addAlias(Object alias)
- {
- Set<Object> aliases = beanMetaData.getAliases();
- if (aliases == null)
- {
- aliases = new HashSet<Object>();
- beanMetaData.setAliases(aliases);
- }
- aliases.add(alias);
- return this;
- }
-
- /**
- * Create annotation metadata.
- *
- * @param annotation the string annotation
- * @return the annotation metadata
- */
- protected AnnotationMetaData createAnnotationMetaData(String annotation)
- {
- return new AbstractAnnotationMetaData(annotation);
- }
-
- /**
- * Create annotation metadata.
- *
- * @param annotation the real annotation
- * @return the annotation metadata
- */
- protected AnnotationMetaData createAnnotationMetaData(Annotation annotation)
- {
- return new DirectAnnotationMetaData(annotation);
- }
-
- /**
- * Create annotation metadata.
- *
- * @param annotation the string annotation
- * @param replace the replace flag
- * @return the annotation metadata
- */
- protected AnnotationMetaData createAnnotationMetaData(String annotation, boolean replace)
- {
- AbstractAnnotationMetaData amd = new AbstractAnnotationMetaData(annotation);
- amd.setReplace(replace);
- return amd;
- }
-
- public BeanMetaDataBuilder setAnnotations(Set<String> annotations)
- {
- if (annotations != null && annotations.isEmpty() == false)
- {
- Set<AnnotationMetaData> amds = new HashSet<AnnotationMetaData>();
- for (String annotation : annotations)
- {
- AnnotationMetaData amd = createAnnotationMetaData(annotation);
- amds.add(amd);
- }
- beanMetaData.setAnnotations(amds);
- }
- return this;
- }
-
- /**
- * Get the annotations.
- *
- * @return the annotations
- */
- protected Set<AnnotationMetaData> getAnnotations()
- {
- Set<AnnotationMetaData> annotations = beanMetaData.getAnnotations();
- if (annotations == null)
- {
- annotations = new HashSet<AnnotationMetaData>();
- beanMetaData.setAnnotations(annotations);
- }
- return annotations;
- }
-
- public BeanMetaDataBuilder addAnnotation(String annotation)
- {
- Set<AnnotationMetaData> annotations = getAnnotations();
- AnnotationMetaData amd = createAnnotationMetaData(annotation);
- annotations.add(amd);
- return this;
- }
-
- public BeanMetaDataBuilder addAnnotation(Annotation annotation)
- {
- Set<AnnotationMetaData> annotations = getAnnotations();
- AnnotationMetaData amd = createAnnotationMetaData(annotation);
- annotations.add(amd);
- return this;
- }
-
- public BeanMetaDataBuilder addAnnotation(String annotation, boolean replace)
- {
- Set<AnnotationMetaData> annotations = getAnnotations();
- AnnotationMetaData amd = createAnnotationMetaData(annotation, replace);
- annotations.add(amd);
- return this;
- }
-
- public BeanMetaDataBuilder setMode(ControllerMode mode)
- {
- beanMetaData.setMode(mode);
- return this;
- }
-
- public BeanMetaDataBuilder setAccessMode(BeanAccessMode mode)
- {
- beanMetaData.setAccessMode(mode);
- return this;
- }
-
- public BeanMetaDataBuilder setErrorHandlingMode(ErrorHandlingMode mode)
- {
- beanMetaData.setErrorHandlingMode(mode);
- return this;
- }
-
- public BeanMetaDataBuilder setAutowireType(AutowireType type)
- {
- beanMetaData.setAutowireType(type);
- return this;
- }
-
- public BeanMetaDataBuilder setAutowireCandidate(boolean candidate)
- {
- beanMetaData.setAutowireCandidate(candidate);
- return null;
- }
-
- /**
- * Create class loader metadata.
- *
- * @param classLoader the classloader value
- * @return the classloader metadata
- */
- protected ClassLoaderMetaData createClassLoaderMetaData(ValueMetaData classLoader)
- {
- return new AbstractClassLoaderMetaData(classLoader);
- }
-
- public BeanMetaDataBuilder setClassLoader(ValueMetaData classLoader)
- {
- ClassLoaderMetaData clvmd = createClassLoaderMetaData(classLoader);
- beanMetaData.setClassLoader(clvmd);
- return this;
- }
-
- public BeanMetaDataBuilder setClassLoader(ClassLoaderMetaData classLoader)
- {
- beanMetaData.setClassLoader(classLoader);
- return this;
- }
-
- /**
- * Create abstract constructor metadata.
- *
- * @return abstract constructor metadata
- */
- protected AbstractConstructorMetaData createAbstractConstructorMetaData()
- {
- return new AbstractConstructorMetaData();
- }
-
- /**
- * Create constructor metadata on demand.
- */
- protected void checkConstructorBuilder()
- {
- AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor();
- if (constructor == null)
- {
- constructor = createAbstractConstructorMetaData();
- beanMetaData.setConstructor(constructor);
- constructorBuilder = new ParameterMetaDataBuilderImpl<AbstractConstructorMetaData>(constructor);
- }
- }
-
- public BeanMetaDataBuilder setFactory(ValueMetaData factory)
- {
- checkConstructorBuilder();
- AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor();
- constructor.setFactory(factory);
- return this;
- }
-
- public BeanMetaDataBuilder setFactoryClass(String factoryClass)
- {
- checkConstructorBuilder();
- AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor();
- constructor.setFactoryClass(factoryClass);
- return this;
- }
-
- public BeanMetaDataBuilder setFactoryMethod(String factoryMethod)
- {
- checkConstructorBuilder();
- AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor();
- constructor.setFactoryMethod(factoryMethod);
- return this;
- }
-
- public BeanMetaDataBuilder setConstructorValue(ValueMetaData value)
- {
- checkConstructorBuilder();
- AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor();
- constructor.setValue(value);
- return this;
- }
-
- public BeanMetaDataBuilder addConstructorParameter(String type, Object value)
- {
- checkConstructorBuilder();
- constructorBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder addConstructorParameter(String type, String value)
- {
- checkConstructorBuilder();
- constructorBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder addConstructorParameter(String type, ValueMetaData value)
- {
- checkConstructorBuilder();
- constructorBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- /**
- * Create property metadata.
- *
- * @param name the name
- * @param value the value
- * @return property metadata
- */
- protected PropertyMetaData createPropertyMetaData(String name, Object value)
- {
- return new AbstractPropertyMetaData(name, value);
- }
-
- public BeanMetaDataBuilder addPropertyMetaData(String name, Object value)
- {
- Set<PropertyMetaData> properties = getProperties();
- removeProperty(properties, name);
- properties.add(createPropertyMetaData(name, value));
- return this;
- }
-
- /**
- * Create property metadata.
- *
- * @param name the name
- * @param value the value
- * @return property metadata
- */
- protected PropertyMetaData createPropertyMetaData(String name, String value)
- {
- return new AbstractPropertyMetaData(name, value);
- }
-
- public BeanMetaDataBuilder addPropertyMetaData(String name, String value)
- {
- Set<PropertyMetaData> properties = getProperties();
- removeProperty(properties, name);
- properties.add(createPropertyMetaData(name, value));
- return this;
- }
-
- /**
- * Create property metadata.
- *
- * @param name the name
- * @param value the value
- * @return property metadata
- */
- protected PropertyMetaData createPropertyMetaData(String name, ValueMetaData value)
- {
- return new AbstractPropertyMetaData(name, value);
- }
-
- public BeanMetaDataBuilder addPropertyMetaData(String name, ValueMetaData value)
- {
- Set<PropertyMetaData> properties = getProperties();
- removeProperty(properties, name);
- properties.add(createPropertyMetaData(name, value));
- return this;
- }
-
- public BeanMetaDataBuilder addPropertyMetaData(String name, Collection<ValueMetaData> value)
- {
- Set<PropertyMetaData> properties = getProperties();
- removeProperty(properties, name);
-
- if (value instanceof ValueMetaData)
- {
- properties.add(createPropertyMetaData(name, (ValueMetaData)value));
- }
- else
- {
- properties.add(createPropertyMetaData(name, value));
- }
- return this;
- }
-
- public BeanMetaDataBuilder addPropertyMetaData(String name, Map<ValueMetaData, ValueMetaData> value)
- {
- Set<PropertyMetaData> properties = getProperties();
- removeProperty(properties, name);
-
- if (value instanceof ValueMetaData)
- {
- properties.add(createPropertyMetaData(name, (ValueMetaData)value));
- }
- else
- {
- properties.add(createPropertyMetaData(name, value));
- }
- return this;
- }
-
- /**
- * Remove previous matching property.
- *
- * @param properties the properties
- * @param name the name
- * @return modified set of properties
- */
- private Set<PropertyMetaData> removeProperty(Set<PropertyMetaData> properties, String name)
- {
- for (Iterator<PropertyMetaData> it = properties.iterator() ; it.hasNext() ; )
- {
- PropertyMetaData property = it.next();
- if (name.equals(property.getName()))
- {
- it.remove();
- }
- }
- return properties;
- }
-
- /**
- * Get the properties.
- *
- * @return the properties
- */
- private Set<PropertyMetaData> getProperties()
- {
- Set<PropertyMetaData> properties = beanMetaData.getProperties();
- if (properties == null)
- {
- properties = new HashSet<PropertyMetaData>();
- beanMetaData.setProperties(properties);
- }
- return properties;
- }
-
- public BeanMetaDataBuilder ignoreCreate()
- {
- createBuilder.setIgnored();
- return this;
- }
-
- public BeanMetaDataBuilder setCreate(String methodName)
- {
- createBuilder.createStateActionMetaData(methodName);
- return this;
- }
-
- public BeanMetaDataBuilder addCreateParameter(String type, Object value)
- {
- createBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder addCreateParameter(String type, String value)
- {
- createBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder addCreateParameter(String type, ValueMetaData value)
- {
- createBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder ignoreStart()
- {
- startBuilder.setIgnored();
- return this;
- }
-
- public BeanMetaDataBuilder setStart(String methodName)
- {
- startBuilder.createStateActionMetaData(methodName);
- return this;
- }
-
- public BeanMetaDataBuilder addStartParameter(String type, Object value)
- {
- startBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder addStartParameter(String type, String value)
- {
- startBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder addStartParameter(String type, ValueMetaData value)
- {
- startBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder ignoreStop()
- {
- stopBuilder.setIgnored();
- return this;
- }
-
- public BeanMetaDataBuilder setStop(String methodName)
- {
- stopBuilder.createStateActionMetaData(methodName);
- return this;
- }
-
- public BeanMetaDataBuilder addStopParameter(String type, Object value)
- {
- stopBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder addStopParameter(String type, String value)
- {
- stopBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder addStopParameter(String type, ValueMetaData value)
- {
- stopBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder ignoreDestroy()
- {
- destroyBuilder.setIgnored();
- return this;
- }
-
- public BeanMetaDataBuilder setDestroy(String methodName)
- {
- destroyBuilder.createStateActionMetaData(methodName);
- return this;
- }
-
- public BeanMetaDataBuilder addDestroyParameter(String type, Object value)
- {
- destroyBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder addDestroyParameter(String type, String value)
- {
- destroyBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- public BeanMetaDataBuilder addDestroyParameter(String type, ValueMetaData value)
- {
- destroyBuilder.addParameterMetaData(type, value);
- return this;
- }
-
- /**
- * Create supply metadata.
- *
- * @param supply the supply
- * @param type the type
- * @return supply metadata
- */
- protected SupplyMetaData createSupplyMetaData(Object supply, String type)
- {
- AbstractSupplyMetaData asmd = new AbstractSupplyMetaData(supply);
- if (type != null)
- asmd.setType(type);
- return asmd;
- }
-
- public BeanMetaDataBuilder addSupply(Object supply, String type)
- {
- Set<SupplyMetaData> supplies = beanMetaData.getSupplies();
- if (supplies == null)
- {
- supplies = new HashSet<SupplyMetaData>();
- beanMetaData.setSupplies(supplies);
- }
- supplies.add(createSupplyMetaData(supply, type));
- return this;
- }
-
- /**
- * Create demand metadata.
- *
- * @param demand the demand
- * @param whenRequired the when required
- * @param transformer the transformer
- * @return the demand metadata
- */
- protected DemandMetaData createDemandMetaData(Object demand, ControllerState whenRequired, String transformer)
- {
- AbstractDemandMetaData admd = new AbstractDemandMetaData(demand);
- if (whenRequired != null)
- admd.setWhenRequired(whenRequired);
- if (transformer != null)
- admd.setTransformer(transformer);
- return admd;
- }
-
- public BeanMetaDataBuilder addDemand(Object demand, ControllerState whenRequired, String transformer)
- {
- Set<DemandMetaData> demands = beanMetaData.getDemands();
- if (demands == null)
- {
- demands = new HashSet<DemandMetaData>();
- beanMetaData.setDemands(demands);
- }
- demands.add(createDemandMetaData(demand, whenRequired, transformer));
- return this;
- }
-
- /**
- * Create dependency metadata.
- *
- * @param dependency the dependency
- * @return the dependency metadata
- */
- protected DependencyMetaData createDependencyMetaData(Object dependency)
- {
- return new AbstractDependencyMetaData(dependency);
- }
-
- public BeanMetaDataBuilder addDependency(Object dependency)
- {
- Set<DependencyMetaData> dependencies = beanMetaData.getDepends();
- if (dependencies == null)
- {
- dependencies = new HashSet<DependencyMetaData>();
- beanMetaData.setDepends(dependencies);
- }
- dependencies.add(createDependencyMetaData(dependency));
- return this;
- }
-
- public ParameterMetaDataBuilder addInstallWithParameters(String methodName, String bean, ControllerState state, ControllerState whenRequired)
- {
- AbstractInstallMetaData install = installBuilder.createStateActionMetaData(methodName);
- install.setBean(bean);
- if (state != null)
- install.setDependentState(state);
- if (whenRequired != null)
- install.setState(whenRequired);
- return new ParameterMetaDataBuilderImpl<AbstractInstallMetaData>(install);
- }
-
- public ParameterMetaDataBuilder addUninstallWithParameters(String methodName, String bean, ControllerState state, ControllerState whenRequired)
- {
- AbstractInstallMetaData uninstall = uninstallBuilder.createStateActionMetaData(methodName);
- uninstall.setBean(bean);
- if (state != null)
- uninstall.setDependentState(state);
- if (whenRequired != null)
- uninstall.setState(whenRequired);
- return new ParameterMetaDataBuilderImpl<AbstractInstallMetaData>(uninstall);
- }
-
- public BeanMetaDataBuilder addPropertyInstallCallback(String property, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality)
- {
- AbstractCallbackMetaData callback = propIncallbackBuilder.createStateActionMetaData(property);
- callback.setSignature(signature);
- callback.setState(whenRequired);
- if (dependentState != null)
- callback.setDependentState(dependentState);
- callback.setCardinality(cardinality);
- return this;
- }
-
- public BeanMetaDataBuilder addPropertyUninstallCallback(String property, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality)
- {
- AbstractCallbackMetaData callback = propUncallbackBuilder.createStateActionMetaData(property);
- callback.setSignature(signature);
- callback.setState(whenRequired);
- if (dependentState != null)
- callback.setDependentState(dependentState);
- callback.setCardinality(cardinality);
- return this;
- }
-
- public BeanMetaDataBuilder addMethodInstallCallback(String method, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality)
- {
- AbstractCallbackMetaData callback = incallbackBuilder.createStateActionMetaData(method);
- callback.setSignature(signature);
- callback.setState(whenRequired);
- if (dependentState != null)
- callback.setDependentState(dependentState);
- callback.setCardinality(cardinality);
- return this;
- }
-
- public BeanMetaDataBuilder addMethodUninstallCallback(String method, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality)
- {
- AbstractCallbackMetaData callback = uncallbackBuilder.createStateActionMetaData(method);
- callback.setSignature(signature);
- callback.setState(whenRequired);
- if (dependentState != null)
- callback.setDependentState(dependentState);
- callback.setCardinality(cardinality);
- return this;
- }
-
- public RelatedClassMetaData createRelated(String className, Object... enabled)
- {
- AbstractRelatedClassMetaData related = new AbstractRelatedClassMetaData();
- related.setClassName(className);
- if (enabled != null && enabled.length > 0)
- related.setEnabled(new HashSet<Object>(Arrays.asList(enabled)));
- return related;
- }
-
- public ValueMetaData createNull()
- {
- return new AbstractValueMetaData();
- }
-
- public ValueMetaData createThis()
- {
- return new ThisValueMetaData();
- }
-
- public ValueMetaData createValue(Object value)
- {
- return new AbstractValueMetaData(value);
- }
-
- public ValueMetaData createString(String type, String value)
- {
- StringValueMetaData result = new StringValueMetaData(value);
- result.setType(type);
- return result;
- }
-
- /**
- * Create abstract dependency metadata.
- *
- * @param bean the bean
- * @param property the property
- * @return abstract dependency value metadata
- */
- protected AbstractDependencyValueMetaData createAbstractDependencyValueMetaData(Object bean, String property)
- {
- return new AbstractDependencyValueMetaData(bean, property);
- }
-
- public ValueMetaData createInject(Object bean, String property, ControllerState whenRequired, ControllerState dependentState)
- {
- AbstractDependencyValueMetaData result = createAbstractDependencyValueMetaData(bean, property);
- if (whenRequired != null)
- result.setWhenRequiredState(whenRequired);
- if (dependentState != null)
- result.setDependentState(dependentState);
- return result;
- }
-
- @SuppressWarnings("unchecked")
- public Collection<ValueMetaData> createCollection(String collectionType, String elementType)
- {
- AbstractCollectionMetaData collection = new AbstractCollectionMetaData();
- if (collectionType != null)
- collection.setType(collectionType);
- if (elementType != null)
- collection.setElementType(elementType);
- return (Collection) collection;
- }
-
- @SuppressWarnings("unchecked")
- public List<ValueMetaData> createList(String listType, String elementType)
- {
- AbstractListMetaData collection = new AbstractListMetaData();
- if (listType != null)
- collection.setType(listType);
- if (elementType != null)
- collection.setElementType(elementType);
- return (List) collection;
- }
-
- @SuppressWarnings("unchecked")
- public Set<ValueMetaData> createSet(String setType, String elementType)
- {
- AbstractSetMetaData collection = new AbstractSetMetaData();
- if (setType != null)
- collection.setType(setType);
- if (elementType != null)
- collection.setElementType(elementType);
- return (Set) collection;
- }
-
- @SuppressWarnings("unchecked")
- public List<ValueMetaData> createArray(String arrayType, String elementType)
- {
- AbstractArrayMetaData collection = new AbstractArrayMetaData();
- if (arrayType != null)
- collection.setType(arrayType);
- if (elementType != null)
- collection.setElementType(elementType);
- return (List) collection;
- }
-
- @SuppressWarnings("unchecked")
- public Map<ValueMetaData, ValueMetaData> createMap(String mapType, String keyType, String valueType)
- {
- AbstractMapMetaData map = new AbstractMapMetaData();
- if (mapType != null)
- map.setType(mapType);
- if (keyType != null)
- map.setKeyType(keyType);
- if (valueType != null)
- map.setValue(valueType);
- return (Map) map;
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,1087 @@
+/*
+* 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.beans.metadata.plugins.builder;
+
+import java.lang.annotation.Annotation;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.beans.info.spi.BeanAccessMode;
+import org.jboss.beans.metadata.api.model.AutowireType;
+import org.jboss.beans.metadata.api.model.InjectOption;
+import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData;
+import org.jboss.beans.metadata.plugins.AbstractArrayMetaData;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData;
+import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData;
+import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData;
+import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData;
+import org.jboss.beans.metadata.plugins.AbstractDemandMetaData;
+import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData;
+import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData;
+import org.jboss.beans.metadata.plugins.AbstractInstallMetaData;
+import org.jboss.beans.metadata.plugins.AbstractListMetaData;
+import org.jboss.beans.metadata.plugins.AbstractMapMetaData;
+import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
+import org.jboss.beans.metadata.plugins.AbstractRelatedClassMetaData;
+import org.jboss.beans.metadata.plugins.AbstractSetMetaData;
+import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData;
+import org.jboss.beans.metadata.plugins.AbstractValueMetaData;
+import org.jboss.beans.metadata.plugins.DirectAnnotationMetaData;
+import org.jboss.beans.metadata.plugins.StringValueMetaData;
+import org.jboss.beans.metadata.plugins.ThisValueMetaData;
+import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData;
+import org.jboss.beans.metadata.spi.AnnotationMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
+import org.jboss.beans.metadata.spi.DemandMetaData;
+import org.jboss.beans.metadata.spi.DependencyMetaData;
+import org.jboss.beans.metadata.spi.PropertyMetaData;
+import org.jboss.beans.metadata.spi.RelatedClassMetaData;
+import org.jboss.beans.metadata.spi.SupplyMetaData;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.beans.metadata.spi.builder.ParameterMetaDataBuilder;
+import org.jboss.dependency.spi.Cardinality;
+import org.jboss.dependency.spi.ControllerMode;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.ErrorHandlingMode;
+
+/**
+ * Helper class.
+ * Similar to StringBuffer, methods return current instance of BeanMetaDataBuilder.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ */
+class BeanMetaDataBuilderImpl extends BeanMetaDataBuilder
+{
+ /** The bean metadata */
+ private AbstractBeanMetaData beanMetaData;
+
+ /** The constructor builder */
+ private ParameterMetaDataBuilderImpl<AbstractConstructorMetaData> constructorBuilder;
+
+ /** The create lifecycle builder */
+ private LifecycleMetaDataBuilder createBuilder;
+
+ /** The start lifecycle builder */
+ private LifecycleMetaDataBuilder startBuilder;
+
+ /** The stop lifecycle builder */
+ private LifecycleMetaDataBuilder stopBuilder;
+
+ /** The destroy lifecycle builder */
+ private LifecycleMetaDataBuilder destroyBuilder;
+
+ /** The install builder */
+ private StateActionBuilder<AbstractInstallMetaData> installBuilder;
+
+ /** The uninstall builder */
+ private StateActionBuilder<AbstractInstallMetaData> uninstallBuilder;
+
+ /** The incallback builder */
+ private StateActionBuilder<AbstractCallbackMetaData> propIncallbackBuilder;
+
+ /** The uncallback builder */
+ private StateActionBuilder<AbstractCallbackMetaData> propUncallbackBuilder;
+
+ /** The incallback builder */
+ private StateActionBuilder<AbstractCallbackMetaData> incallbackBuilder;
+
+ /** The uncallback builder */
+ private StateActionBuilder<AbstractCallbackMetaData> uncallbackBuilder;
+
+ /**
+ * Create a new BeanMetaDataBuilderImpl.
+ *
+ * @param bean the bean
+ */
+ public BeanMetaDataBuilderImpl(String bean)
+ {
+ this(new AbstractBeanMetaData(bean));
+ }
+
+ /**
+ * Create a new BeanMetaDataBuilderImpl.
+ *
+ * @param name the bean name
+ * @param bean the bean
+ */
+ public BeanMetaDataBuilderImpl(String name, String bean)
+ {
+ this(new AbstractBeanMetaData(name, bean));
+ }
+
+ /**
+ * Create a new BeanMetaDataBuilderImpl.
+ *
+ * @param beanMetaData the bean metadata
+ */
+ public BeanMetaDataBuilderImpl(AbstractBeanMetaData beanMetaData)
+ {
+ this.beanMetaData = beanMetaData;
+ // lifecycle builders
+ createBuilder = createCreateLifecycleMetaDataBuilder(beanMetaData);
+ startBuilder = createStartLifecycleMetaDataBuilder(beanMetaData);
+ stopBuilder = createStopLifecycleMetaDataBuilder(beanMetaData);
+ destroyBuilder = createDestroyLifecycleMetaDataBuilder(beanMetaData);
+ // install
+ installBuilder = createInstallMetaDataBuilder(beanMetaData);
+ uninstallBuilder = createUninstallMetaDataBuilder(beanMetaData);
+ // callback
+ propIncallbackBuilder = createPropertyInstallCallbackMetaDataBuilder(beanMetaData);
+ propUncallbackBuilder = createPropertyUninstallCallbackMetaDataBuilder(beanMetaData);
+ incallbackBuilder = createInstallCallbackMetaDataBuilder(beanMetaData);
+ uncallbackBuilder = createUninstallCallbackMetaDataBuilder(beanMetaData);
+ }
+
+ /**
+ * Create lifecycle metadata builder.
+ *
+ * @param beanMetaData the bean metadata
+ * @return the lifecycle metadata builder
+ */
+ protected LifecycleMetaDataBuilder createCreateLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData)
+ {
+ return new CreateLifecycleMetaDataBuilder(beanMetaData);
+ }
+
+ /**
+ * Create lifecycle metadata builder.
+ *
+ * @param beanMetaData the bean metadata
+ * @return the lifecycle metadata builder
+ */
+ protected LifecycleMetaDataBuilder createStartLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData)
+ {
+ return new StartLifecycleMetaDataBuilder(beanMetaData);
+ }
+
+ /**
+ * Create lifecycle metadata builder.
+ *
+ * @param beanMetaData the bean metadata
+ * @return the lifecycle metadata builder
+ */
+ protected LifecycleMetaDataBuilder createStopLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData)
+ {
+ return new StopLifecycleMetaDataBuilder(beanMetaData);
+ }
+
+ /**
+ * Create lifecycle metadata builder.
+ *
+ * @param beanMetaData the bean metadata
+ * @return the lifecycle metadata builder
+ */
+ protected LifecycleMetaDataBuilder createDestroyLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData)
+ {
+ return new DestroyLifecycleMetaDataBuilder(beanMetaData);
+ }
+
+ /**
+ * Create install metadata builder.
+ *
+ * @param beanMetaData the bean metadata
+ * @return the install builder
+ */
+ protected StateActionBuilder<AbstractInstallMetaData> createInstallMetaDataBuilder(AbstractBeanMetaData beanMetaData)
+ {
+ return new InstallMetaDataBuilder(beanMetaData);
+ }
+
+ /**
+ * Create install metadata builder.
+ *
+ * @param beanMetaData the bean metadata
+ * @return the install builder
+ */
+ protected StateActionBuilder<AbstractInstallMetaData> createUninstallMetaDataBuilder(AbstractBeanMetaData beanMetaData)
+ {
+ return new UninstallMetaDataBuilder(beanMetaData);
+ }
+
+ /**
+ * Create callback metadata builder.
+ *
+ * @param beanMetaData the bean metadata
+ * @return the callback metadata builder
+ */
+ private StateActionBuilder<AbstractCallbackMetaData> createPropertyInstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData)
+ {
+ return new PropertyInstallCallbackMetaDataBuilder(beanMetaData);
+ }
+
+ /**
+ * Create callback metadata builder.
+ *
+ * @param beanMetaData the bean metadata
+ * @return the callback metadata builder
+ */
+ private StateActionBuilder<AbstractCallbackMetaData> createPropertyUninstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData)
+ {
+ return new PropertyUninstallCallbackMetaDataBuilder(beanMetaData);
+ }
+
+ /**
+ * Create callback metadata builder.
+ *
+ * @param beanMetaData the bean metadata
+ * @return the callback metadata builder
+ */
+ private StateActionBuilder<AbstractCallbackMetaData> createInstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData)
+ {
+ return new InstallCallbackMetaDataBuilder(beanMetaData);
+ }
+
+ /**
+ * Create callback metadata builder.
+ *
+ * @param beanMetaData the bean metadata
+ * @return the callback metadata builder
+ */
+ private StateActionBuilder<AbstractCallbackMetaData> createUninstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData)
+ {
+ return new UninstallCallbackMetaDataBuilder(beanMetaData);
+ }
+
+ public BeanMetaData getBeanMetaData()
+ {
+ return beanMetaData;
+ }
+
+ public BeanMetaDataFactory getBeanMetaDataFactory()
+ {
+ return beanMetaData;
+ }
+
+ public BeanMetaDataBuilder setName(String name)
+ {
+ beanMetaData.setName(name);
+ return this;
+ }
+
+ public BeanMetaDataBuilder setBean(String bean)
+ {
+ beanMetaData.setBean(bean);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addRelatedClass(String className, Object... enabled)
+ {
+ RelatedClassMetaData related = createRelated(className, enabled);
+ return addRelatedClass(related);
+ }
+
+ public BeanMetaDataBuilder addRelatedClass(RelatedClassMetaData related)
+ {
+ Set<RelatedClassMetaData> relatedSet = beanMetaData.getRelated();
+ if (relatedSet == null)
+ {
+ relatedSet = new HashSet<RelatedClassMetaData>();
+ beanMetaData.setRelated(relatedSet);
+ }
+ relatedSet.add(related);
+ return this;
+ }
+
+ public BeanMetaDataBuilder setRelated(Set<RelatedClassMetaData> related)
+ {
+ beanMetaData.setRelated(related);
+ return this;
+ }
+
+ public BeanMetaDataBuilder setAliases(Set<Object> aliases)
+ {
+ beanMetaData.setAliases(aliases);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addAlias(Object alias)
+ {
+ Set<Object> aliases = beanMetaData.getAliases();
+ if (aliases == null)
+ {
+ aliases = new HashSet<Object>();
+ beanMetaData.setAliases(aliases);
+ }
+ aliases.add(alias);
+ return this;
+ }
+
+ /**
+ * Create annotation metadata.
+ *
+ * @param annotation the string annotation
+ * @return the annotation metadata
+ */
+ protected AnnotationMetaData createAnnotationMetaData(String annotation)
+ {
+ return new AbstractAnnotationMetaData(annotation);
+ }
+
+ /**
+ * Create annotation metadata.
+ *
+ * @param annotation the real annotation
+ * @return the annotation metadata
+ */
+ protected AnnotationMetaData createAnnotationMetaData(Annotation annotation)
+ {
+ return new DirectAnnotationMetaData(annotation);
+ }
+
+ /**
+ * Create annotation metadata.
+ *
+ * @param annotation the string annotation
+ * @param replace the replace flag
+ * @return the annotation metadata
+ */
+ protected AnnotationMetaData createAnnotationMetaData(String annotation, boolean replace)
+ {
+ AbstractAnnotationMetaData amd = new AbstractAnnotationMetaData(annotation);
+ amd.setReplace(replace);
+ return amd;
+ }
+
+ public BeanMetaDataBuilder setAnnotations(Set<String> annotations)
+ {
+ if (annotations != null && annotations.isEmpty() == false)
+ {
+ Set<AnnotationMetaData> amds = new HashSet<AnnotationMetaData>();
+ for (String annotation : annotations)
+ {
+ AnnotationMetaData amd = createAnnotationMetaData(annotation);
+ amds.add(amd);
+ }
+ beanMetaData.setAnnotations(amds);
+ }
+ return this;
+ }
+
+ /**
+ * Get the annotations.
+ *
+ * @return the annotations
+ */
+ protected Set<AnnotationMetaData> getAnnotations()
+ {
+ Set<AnnotationMetaData> annotations = beanMetaData.getAnnotations();
+ if (annotations == null)
+ {
+ annotations = new HashSet<AnnotationMetaData>();
+ beanMetaData.setAnnotations(annotations);
+ }
+ return annotations;
+ }
+
+ public BeanMetaDataBuilder addAnnotation(String annotation)
+ {
+ Set<AnnotationMetaData> annotations = getAnnotations();
+ AnnotationMetaData amd = createAnnotationMetaData(annotation);
+ annotations.add(amd);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addAnnotation(Annotation annotation)
+ {
+ Set<AnnotationMetaData> annotations = getAnnotations();
+ AnnotationMetaData amd = createAnnotationMetaData(annotation);
+ annotations.add(amd);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addAnnotation(String annotation, boolean replace)
+ {
+ Set<AnnotationMetaData> annotations = getAnnotations();
+ AnnotationMetaData amd = createAnnotationMetaData(annotation, replace);
+ annotations.add(amd);
+ return this;
+ }
+
+ public BeanMetaDataBuilder setMode(ControllerMode mode)
+ {
+ beanMetaData.setMode(mode);
+ return this;
+ }
+
+ public BeanMetaDataBuilder setAccessMode(BeanAccessMode mode)
+ {
+ beanMetaData.setAccessMode(mode);
+ return this;
+ }
+
+ public BeanMetaDataBuilder setErrorHandlingMode(ErrorHandlingMode mode)
+ {
+ beanMetaData.setErrorHandlingMode(mode);
+ return this;
+ }
+
+ public BeanMetaDataBuilder setAutowireType(AutowireType type)
+ {
+ beanMetaData.setAutowireType(type);
+ return this;
+ }
+
+ public BeanMetaDataBuilder setAutowireCandidate(boolean candidate)
+ {
+ beanMetaData.setAutowireCandidate(candidate);
+ return null;
+ }
+
+ /**
+ * Create class loader metadata.
+ *
+ * @param classLoader the classloader value
+ * @return the classloader metadata
+ */
+ protected ClassLoaderMetaData createClassLoaderMetaData(ValueMetaData classLoader)
+ {
+ return new AbstractClassLoaderMetaData(classLoader);
+ }
+
+ public BeanMetaDataBuilder setClassLoader(ValueMetaData classLoader)
+ {
+ ClassLoaderMetaData clvmd = createClassLoaderMetaData(classLoader);
+ beanMetaData.setClassLoader(clvmd);
+ return this;
+ }
+
+ public BeanMetaDataBuilder setClassLoader(ClassLoaderMetaData classLoader)
+ {
+ beanMetaData.setClassLoader(classLoader);
+ return this;
+ }
+
+ /**
+ * Create abstract constructor metadata.
+ *
+ * @return abstract constructor metadata
+ */
+ protected AbstractConstructorMetaData createAbstractConstructorMetaData()
+ {
+ return new AbstractConstructorMetaData();
+ }
+
+ /**
+ * Create constructor metadata on demand.
+ */
+ protected void checkConstructorBuilder()
+ {
+ AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor();
+ if (constructor == null)
+ {
+ constructor = createAbstractConstructorMetaData();
+ beanMetaData.setConstructor(constructor);
+ constructorBuilder = new ParameterMetaDataBuilderImpl<AbstractConstructorMetaData>(constructor);
+ }
+ }
+
+ public BeanMetaDataBuilder setFactory(ValueMetaData factory)
+ {
+ checkConstructorBuilder();
+ AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor();
+ constructor.setFactory(factory);
+ return this;
+ }
+
+ public BeanMetaDataBuilder setFactoryClass(String factoryClass)
+ {
+ checkConstructorBuilder();
+ AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor();
+ constructor.setFactoryClass(factoryClass);
+ return this;
+ }
+
+ public BeanMetaDataBuilder setFactoryMethod(String factoryMethod)
+ {
+ checkConstructorBuilder();
+ AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor();
+ constructor.setFactoryMethod(factoryMethod);
+ return this;
+ }
+
+ public BeanMetaDataBuilder setConstructorValue(ValueMetaData value)
+ {
+ checkConstructorBuilder();
+ AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor();
+ constructor.setValue(value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addConstructorParameter(String type, Object value)
+ {
+ checkConstructorBuilder();
+ constructorBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addConstructorParameter(String type, String value)
+ {
+ checkConstructorBuilder();
+ constructorBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addConstructorParameter(String type, ValueMetaData value)
+ {
+ checkConstructorBuilder();
+ constructorBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ /**
+ * Create property metadata.
+ *
+ * @param name the name
+ * @param value the value
+ * @return property metadata
+ */
+ protected PropertyMetaData createPropertyMetaData(String name, Object value)
+ {
+ return new AbstractPropertyMetaData(name, value);
+ }
+
+ public BeanMetaDataBuilder addPropertyMetaData(String name, Object value)
+ {
+ Set<PropertyMetaData> properties = getProperties();
+ removeProperty(properties, name);
+ properties.add(createPropertyMetaData(name, value));
+ return this;
+ }
+
+ /**
+ * Create property metadata.
+ *
+ * @param name the name
+ * @param value the value
+ * @return property metadata
+ */
+ protected PropertyMetaData createPropertyMetaData(String name, String value)
+ {
+ return new AbstractPropertyMetaData(name, value);
+ }
+
+ public BeanMetaDataBuilder addPropertyMetaData(String name, String value)
+ {
+ Set<PropertyMetaData> properties = getProperties();
+ removeProperty(properties, name);
+ properties.add(createPropertyMetaData(name, value));
+ return this;
+ }
+
+ /**
+ * Create property metadata.
+ *
+ * @param name the name
+ * @param value the value
+ * @return property metadata
+ */
+ protected PropertyMetaData createPropertyMetaData(String name, ValueMetaData value)
+ {
+ return new AbstractPropertyMetaData(name, value);
+ }
+
+ public BeanMetaDataBuilder addPropertyMetaData(String name, ValueMetaData value)
+ {
+ Set<PropertyMetaData> properties = getProperties();
+ removeProperty(properties, name);
+ properties.add(createPropertyMetaData(name, value));
+ return this;
+ }
+
+ public BeanMetaDataBuilder addPropertyMetaData(String name, Collection<ValueMetaData> value)
+ {
+ Set<PropertyMetaData> properties = getProperties();
+ removeProperty(properties, name);
+
+ if (value instanceof ValueMetaData)
+ {
+ properties.add(createPropertyMetaData(name, (ValueMetaData)value));
+ }
+ else
+ {
+ properties.add(createPropertyMetaData(name, value));
+ }
+ return this;
+ }
+
+ public BeanMetaDataBuilder addPropertyMetaData(String name, Map<ValueMetaData, ValueMetaData> value)
+ {
+ Set<PropertyMetaData> properties = getProperties();
+ removeProperty(properties, name);
+
+ if (value instanceof ValueMetaData)
+ {
+ properties.add(createPropertyMetaData(name, (ValueMetaData)value));
+ }
+ else
+ {
+ properties.add(createPropertyMetaData(name, value));
+ }
+ return this;
+ }
+
+ /**
+ * Remove previous matching property.
+ *
+ * @param properties the properties
+ * @param name the name
+ * @return modified set of properties
+ */
+ private Set<PropertyMetaData> removeProperty(Set<PropertyMetaData> properties, String name)
+ {
+ for (Iterator<PropertyMetaData> it = properties.iterator() ; it.hasNext() ; )
+ {
+ PropertyMetaData property = it.next();
+ if (name.equals(property.getName()))
+ {
+ it.remove();
+ }
+ }
+ return properties;
+ }
+
+ /**
+ * Get the properties.
+ *
+ * @return the properties
+ */
+ private Set<PropertyMetaData> getProperties()
+ {
+ Set<PropertyMetaData> properties = beanMetaData.getProperties();
+ if (properties == null)
+ {
+ properties = new HashSet<PropertyMetaData>();
+ beanMetaData.setProperties(properties);
+ }
+ return properties;
+ }
+
+ public BeanMetaDataBuilder ignoreCreate()
+ {
+ createBuilder.setIgnored();
+ return this;
+ }
+
+ public BeanMetaDataBuilder setCreate(String methodName)
+ {
+ createBuilder.createStateActionMetaData(methodName);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addCreateParameter(String type, Object value)
+ {
+ createBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addCreateParameter(String type, String value)
+ {
+ createBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addCreateParameter(String type, ValueMetaData value)
+ {
+ createBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder ignoreStart()
+ {
+ startBuilder.setIgnored();
+ return this;
+ }
+
+ public BeanMetaDataBuilder setStart(String methodName)
+ {
+ startBuilder.createStateActionMetaData(methodName);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addStartParameter(String type, Object value)
+ {
+ startBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addStartParameter(String type, String value)
+ {
+ startBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addStartParameter(String type, ValueMetaData value)
+ {
+ startBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder ignoreStop()
+ {
+ stopBuilder.setIgnored();
+ return this;
+ }
+
+ public BeanMetaDataBuilder setStop(String methodName)
+ {
+ stopBuilder.createStateActionMetaData(methodName);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addStopParameter(String type, Object value)
+ {
+ stopBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addStopParameter(String type, String value)
+ {
+ stopBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addStopParameter(String type, ValueMetaData value)
+ {
+ stopBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder ignoreDestroy()
+ {
+ destroyBuilder.setIgnored();
+ return this;
+ }
+
+ public BeanMetaDataBuilder setDestroy(String methodName)
+ {
+ destroyBuilder.createStateActionMetaData(methodName);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addDestroyParameter(String type, Object value)
+ {
+ destroyBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addDestroyParameter(String type, String value)
+ {
+ destroyBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addDestroyParameter(String type, ValueMetaData value)
+ {
+ destroyBuilder.addParameterMetaData(type, value);
+ return this;
+ }
+
+ /**
+ * Create supply metadata.
+ *
+ * @param supply the supply
+ * @param type the type
+ * @return supply metadata
+ */
+ protected SupplyMetaData createSupplyMetaData(Object supply, String type)
+ {
+ AbstractSupplyMetaData asmd = new AbstractSupplyMetaData(supply);
+ if (type != null)
+ asmd.setType(type);
+ return asmd;
+ }
+
+ public BeanMetaDataBuilder addSupply(Object supply, String type)
+ {
+ Set<SupplyMetaData> supplies = beanMetaData.getSupplies();
+ if (supplies == null)
+ {
+ supplies = new HashSet<SupplyMetaData>();
+ beanMetaData.setSupplies(supplies);
+ }
+ supplies.add(createSupplyMetaData(supply, type));
+ return this;
+ }
+
+ /**
+ * Create demand metadata.
+ *
+ * @param demand the demand
+ * @param whenRequired the when required
+ * @param transformer the transformer
+ * @return the demand metadata
+ */
+ protected DemandMetaData createDemandMetaData(Object demand, ControllerState whenRequired, String transformer)
+ {
+ AbstractDemandMetaData admd = new AbstractDemandMetaData(demand);
+ if (whenRequired != null)
+ admd.setWhenRequired(whenRequired);
+ if (transformer != null)
+ admd.setTransformer(transformer);
+ return admd;
+ }
+
+ public BeanMetaDataBuilder addDemand(Object demand, ControllerState whenRequired, String transformer)
+ {
+ Set<DemandMetaData> demands = beanMetaData.getDemands();
+ if (demands == null)
+ {
+ demands = new HashSet<DemandMetaData>();
+ beanMetaData.setDemands(demands);
+ }
+ demands.add(createDemandMetaData(demand, whenRequired, transformer));
+ return this;
+ }
+
+ /**
+ * Create dependency metadata.
+ *
+ * @param dependency the dependency
+ * @return the dependency metadata
+ */
+ protected DependencyMetaData createDependencyMetaData(Object dependency)
+ {
+ return new AbstractDependencyMetaData(dependency);
+ }
+
+ public BeanMetaDataBuilder addDependency(Object dependency)
+ {
+ Set<DependencyMetaData> dependencies = beanMetaData.getDepends();
+ if (dependencies == null)
+ {
+ dependencies = new HashSet<DependencyMetaData>();
+ beanMetaData.setDepends(dependencies);
+ }
+ dependencies.add(createDependencyMetaData(dependency));
+ return this;
+ }
+
+ public ParameterMetaDataBuilder addInstallWithParameters(String methodName, String bean, ControllerState state, ControllerState whenRequired)
+ {
+ AbstractInstallMetaData install = installBuilder.createStateActionMetaData(methodName);
+ install.setBean(bean);
+ if (state != null)
+ install.setDependentState(state);
+ if (whenRequired != null)
+ install.setState(whenRequired);
+ return new ParameterMetaDataBuilderImpl<AbstractInstallMetaData>(install);
+ }
+
+ public ParameterMetaDataBuilder addUninstallWithParameters(String methodName, String bean, ControllerState state, ControllerState whenRequired)
+ {
+ AbstractInstallMetaData uninstall = uninstallBuilder.createStateActionMetaData(methodName);
+ uninstall.setBean(bean);
+ if (state != null)
+ uninstall.setDependentState(state);
+ if (whenRequired != null)
+ uninstall.setState(whenRequired);
+ return new ParameterMetaDataBuilderImpl<AbstractInstallMetaData>(uninstall);
+ }
+
+ public BeanMetaDataBuilder addPropertyInstallCallback(String property, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality)
+ {
+ AbstractCallbackMetaData callback = propIncallbackBuilder.createStateActionMetaData(property);
+ callback.setSignature(signature);
+ callback.setState(whenRequired);
+ if (dependentState != null)
+ callback.setDependentState(dependentState);
+ callback.setCardinality(cardinality);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addPropertyUninstallCallback(String property, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality)
+ {
+ AbstractCallbackMetaData callback = propUncallbackBuilder.createStateActionMetaData(property);
+ callback.setSignature(signature);
+ callback.setState(whenRequired);
+ if (dependentState != null)
+ callback.setDependentState(dependentState);
+ callback.setCardinality(cardinality);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addMethodInstallCallback(String method, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality)
+ {
+ AbstractCallbackMetaData callback = incallbackBuilder.createStateActionMetaData(method);
+ callback.setSignature(signature);
+ callback.setState(whenRequired);
+ if (dependentState != null)
+ callback.setDependentState(dependentState);
+ callback.setCardinality(cardinality);
+ return this;
+ }
+
+ public BeanMetaDataBuilder addMethodUninstallCallback(String method, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality)
+ {
+ AbstractCallbackMetaData callback = uncallbackBuilder.createStateActionMetaData(method);
+ callback.setSignature(signature);
+ callback.setState(whenRequired);
+ if (dependentState != null)
+ callback.setDependentState(dependentState);
+ callback.setCardinality(cardinality);
+ return this;
+ }
+
+ public RelatedClassMetaData createRelated(String className, Object... enabled)
+ {
+ AbstractRelatedClassMetaData related = new AbstractRelatedClassMetaData();
+ related.setClassName(className);
+ if (enabled != null && enabled.length > 0)
+ related.setEnabled(new HashSet<Object>(Arrays.asList(enabled)));
+ return related;
+ }
+
+ public ValueMetaData createNull()
+ {
+ return new AbstractValueMetaData();
+ }
+
+ public ValueMetaData createThis()
+ {
+ return new ThisValueMetaData();
+ }
+
+ public ValueMetaData createValue(Object value)
+ {
+ return new AbstractValueMetaData(value);
+ }
+
+ public ValueMetaData createString(String type, String value)
+ {
+ StringValueMetaData result = new StringValueMetaData(value);
+ result.setType(type);
+ return result;
+ }
+
+ /**
+ * Create abstract dependency metadata.
+ *
+ * @param bean the bean
+ * @param property the property
+ * @return abstract dependency value metadata
+ */
+ protected AbstractDependencyValueMetaData createAbstractDependencyValueMetaData(Object bean, String property)
+ {
+ return new AbstractDependencyValueMetaData(bean, property);
+ }
+
+ public ValueMetaData createInject(Object bean, String property, ControllerState whenRequired, ControllerState dependentState)
+ {
+ AbstractDependencyValueMetaData result = createAbstractDependencyValueMetaData(bean, property);
+ if (whenRequired != null)
+ result.setWhenRequiredState(whenRequired);
+ if (dependentState != null)
+ result.setDependentState(dependentState);
+ return result;
+ }
+
+ /**
+ * Create abstract dependency metadata.
+ *
+ * @return abstract dependency value metadata
+ */
+ protected AbstractInjectionValueMetaData createAbstractInjectionValueMetaData()
+ {
+ return new AbstractInjectionValueMetaData();
+ }
+
+ public ValueMetaData createContextualInject(ControllerState whenRequired, ControllerState dependentState, AutowireType autowire, InjectOption option)
+ {
+ AbstractInjectionValueMetaData result = createAbstractInjectionValueMetaData();
+ if (whenRequired != null)
+ result.setWhenRequiredState(whenRequired);
+ if (dependentState != null)
+ result.setDependentState(dependentState);
+ if (autowire != null)
+ result.setInjectionType(autowire);
+ if (option != null)
+ result.setInjectionOption(option);
+ return result;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Collection<ValueMetaData> createCollection(String collectionType, String elementType)
+ {
+ AbstractCollectionMetaData collection = new AbstractCollectionMetaData();
+ if (collectionType != null)
+ collection.setType(collectionType);
+ if (elementType != null)
+ collection.setElementType(elementType);
+ return (Collection) collection;
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<ValueMetaData> createList(String listType, String elementType)
+ {
+ AbstractListMetaData collection = new AbstractListMetaData();
+ if (listType != null)
+ collection.setType(listType);
+ if (elementType != null)
+ collection.setElementType(elementType);
+ return (List) collection;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<ValueMetaData> createSet(String setType, String elementType)
+ {
+ AbstractSetMetaData collection = new AbstractSetMetaData();
+ if (setType != null)
+ collection.setType(setType);
+ if (elementType != null)
+ collection.setElementType(elementType);
+ return (Set) collection;
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<ValueMetaData> createArray(String arrayType, String elementType)
+ {
+ AbstractArrayMetaData collection = new AbstractArrayMetaData();
+ if (arrayType != null)
+ collection.setType(arrayType);
+ if (elementType != null)
+ collection.setElementType(elementType);
+ return (List) collection;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map<ValueMetaData, ValueMetaData> createMap(String mapType, String keyType, String valueType)
+ {
+ AbstractMapMetaData map = new AbstractMapMetaData();
+ if (mapType != null)
+ map.setType(mapType);
+ if (keyType != null)
+ map.setKeyType(keyType);
+ if (valueType != null)
+ map.setValue(valueType);
+ return (Map) map;
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,229 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.beans.metadata.plugins.factory;
-
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Map;
-
-import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.beans.info.spi.PropertyInfo;
-import org.jboss.beans.metadata.spi.ValueMetaData;
-import org.jboss.beans.metadata.spi.factory.AbstractBeanFactory;
-import org.jboss.joinpoint.spi.Joinpoint;
-import org.jboss.kernel.plugins.config.Configurator;
-import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext;
-import org.jboss.kernel.spi.config.KernelConfigurator;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
-import org.jboss.logging.Logger;
-
-/**
- * Bean factory metadata.
- *
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision$
- */
-public class GenericBeanFactory extends AbstractBeanFactory implements KernelControllerContextAware
-{
- /** The log */
- private static final Logger log = Logger.getLogger(GenericBeanFactory.class);
-
- /** Our context */
- protected KernelControllerContext context;
-
- /**
- * Create a new generic bean factory
- *
- * @param configurator the configurator
- */
- public GenericBeanFactory(KernelConfigurator configurator)
- {
- super(configurator);
- }
-
- /**
- * Create a new bean
- *
- * @return the bean
- * @throws Throwable for any error
- */
- public Object createBean() throws Throwable
- {
- final ClassLoader cl = getControllerContextClassLoader();
-
- AccessControlContext acc = getAccessControlContext();
-
- if (acc == null || System.getSecurityManager() == null)
- return createBean(cl);
-
- try
- {
- return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>()
- {
- public Object run() throws Exception
- {
- try
- {
- return createBean(cl);
- }
- catch (Error e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw e;
- }
- catch (Throwable t)
- {
- throw new RuntimeException("Error creating bean", t);
- }
- }
- }, acc);
- }
- catch (PrivilegedActionException e)
- {
- throw e.getCause();
- }
- }
-
- public void setKernelControllerContext(KernelControllerContext context) throws Exception
- {
- this.context = context;
- }
-
- public void unsetKernelControllerContext(KernelControllerContext context) throws Exception
- {
- this.context = null;
- }
-
- /**
- * Get the classloader from the controller context
- *
- * @return the controller context
- * @throws Throwable for any error
- */
- private ClassLoader getControllerContextClassLoader() throws Throwable
- {
- if (context != null)
- {
- if (System.getSecurityManager() == null)
- {
- try
- {
- return context.getClassLoader();
- }
- catch (Throwable t)
- {
- log.trace("Unable to retrieve classloader from " + context);
- return null;
- }
- }
-
- return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
- {
- public ClassLoader run()
- {
- try
- {
- return context.getClassLoader();
- }
- catch (Throwable t)
- {
- log.trace("Unable to retrieve classloader from " + context);
- return null;
- }
- }
- });
- }
- return null;
- }
-
- /**
- * Get the access control context from the controller context
- *
- * @return the access control
- * @throws Throwable for any error
- */
- private AccessControlContext getAccessControlContext() throws Throwable
- {
- if (context != null)
- {
- if (context instanceof AbstractKernelControllerContext == false)
- return null;
-
- final AbstractKernelControllerContext akcc = (AbstractKernelControllerContext) context;
- if (System.getSecurityManager() == null)
- return akcc.getAccessControlContext();
-
- return AccessController.doPrivileged(new PrivilegedAction<AccessControlContext>()
- {
- public AccessControlContext run()
- {
- return akcc.getAccessControlContext();
- }
- });
- }
- return null;
- }
-
- /**
- * Create a new bean
- *
- * @param cl the classloader to use
- * @return the bean
- * @throws Throwable for any error
- */
- protected Object createBean(ClassLoader cl) throws Throwable
- {
- ClassLoader loader = cl;
- if (loader == null)
- loader = Configurator.getClassLoader(classLoader);
- BeanInfo info = null;
- if (bean != null)
- info = configurator.getBeanInfo(bean, loader, accessMode);
-
- Joinpoint joinpoint = configurator.getConstructorJoinPoint(info, constructor, null);
- Object result = joinpoint.dispatch();
- if (info == null && result != null)
- info = configurator.getBeanInfo(result.getClass(), accessMode);
-
- if (properties != null && properties.size() > 0)
- {
- for (Map.Entry<String, ValueMetaData> entry : properties.entrySet())
- {
- String property = entry.getKey();
- ValueMetaData vmd = entry.getValue();
- PropertyInfo pi = info.getProperty(property);
- pi.set(result, vmd.getValue(pi.getType(), loader));
- }
- }
- invokeLifecycle("create", create, info, loader, result);
- invokeLifecycle("start", start, info, loader, result);
- return result;
- }
-}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,230 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, 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.beans.metadata.plugins.factory;
+
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.Map;
+
+import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.beans.metadata.spi.factory.AbstractBeanFactory;
+import org.jboss.joinpoint.spi.Joinpoint;
+import org.jboss.kernel.plugins.config.Configurator;
+import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext;
+import org.jboss.kernel.spi.config.KernelConfigurator;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
+import org.jboss.logging.Logger;
+
+/**
+ * Bean factory metadata.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public class GenericBeanFactory extends AbstractBeanFactory implements KernelControllerContextAware
+{
+ /** The log */
+ private static final Logger log = Logger.getLogger(GenericBeanFactory.class);
+
+ /** Our context */
+ protected KernelControllerContext context;
+
+ /**
+ * Create a new generic bean factory
+ *
+ * @param configurator the configurator
+ */
+ public GenericBeanFactory(KernelConfigurator configurator)
+ {
+ super(configurator);
+ }
+
+ /**
+ * Create a new bean
+ *
+ * @return the bean
+ * @throws Throwable for any error
+ */
+ public Object createBean() throws Throwable
+ {
+ final ClassLoader cl = getControllerContextClassLoader();
+
+ AccessControlContext acc = getAccessControlContext();
+
+ if (acc == null || System.getSecurityManager() == null)
+ return createBean(cl);
+
+ try
+ {
+ return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>()
+ {
+ public Object run() throws Exception
+ {
+ try
+ {
+ return createBean(cl);
+ }
+ catch (Error e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw e;
+ }
+ catch (Throwable t)
+ {
+ throw new RuntimeException("Error creating bean", t);
+ }
+ }
+ }, acc);
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw e.getCause();
+ }
+ }
+
+ public void setKernelControllerContext(KernelControllerContext context) throws Exception
+ {
+ this.context = context;
+ }
+
+ public void unsetKernelControllerContext(KernelControllerContext context) throws Exception
+ {
+ this.context = null;
+ }
+
+ /**
+ * Get the classloader from the controller context
+ *
+ * @return the controller context
+ * @throws Throwable for any error
+ */
+ private ClassLoader getControllerContextClassLoader() throws Throwable
+ {
+ if (context != null)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ try
+ {
+ return context.getClassLoader();
+ }
+ catch (Throwable t)
+ {
+ log.trace("Unable to retrieve classloader from " + context);
+ return null;
+ }
+ }
+
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ try
+ {
+ return context.getClassLoader();
+ }
+ catch (Throwable t)
+ {
+ log.trace("Unable to retrieve classloader from " + context);
+ return null;
+ }
+ }
+ });
+ }
+ return null;
+ }
+
+ /**
+ * Get the access control context from the controller context
+ *
+ * @return the access control
+ * @throws Throwable for any error
+ */
+ private AccessControlContext getAccessControlContext() throws Throwable
+ {
+ if (context != null)
+ {
+ // TODO: JBMICROCONT-386, introduce interface
+ if (context instanceof AbstractKernelControllerContext == false)
+ return null;
+
+ final AbstractKernelControllerContext akcc = (AbstractKernelControllerContext) context;
+ if (System.getSecurityManager() == null)
+ return akcc.getAccessControlContext();
+
+ return AccessController.doPrivileged(new PrivilegedAction<AccessControlContext>()
+ {
+ public AccessControlContext run()
+ {
+ return akcc.getAccessControlContext();
+ }
+ });
+ }
+ return null;
+ }
+
+ /**
+ * Create a new bean
+ *
+ * @param cl the classloader to use
+ * @return the bean
+ * @throws Throwable for any error
+ */
+ protected Object createBean(ClassLoader cl) throws Throwable
+ {
+ ClassLoader loader = cl;
+ if (loader == null)
+ loader = Configurator.getClassLoader(classLoader);
+ BeanInfo info = null;
+ if (bean != null)
+ info = configurator.getBeanInfo(bean, loader, accessMode);
+
+ Joinpoint joinpoint = configurator.getConstructorJoinPoint(info, constructor, null);
+ Object result = joinpoint.dispatch();
+ if (info == null && result != null)
+ info = configurator.getBeanInfo(result.getClass(), accessMode);
+
+ if (properties != null && properties.size() > 0)
+ {
+ for (Map.Entry<String, ValueMetaData> entry : properties.entrySet())
+ {
+ String property = entry.getKey();
+ ValueMetaData vmd = entry.getValue();
+ PropertyInfo pi = info.getProperty(property);
+ pi.set(result, vmd.getValue(pi.getType(), loader));
+ }
+ }
+ invokeLifecycle("create", create, info, loader, result);
+ invokeLifecycle("start", start, info, loader, result);
+ return result;
+ }
+}
\ No newline at end of file
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/main/java/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,1710 +0,0 @@
-/*
-* 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.beans.metadata.spi.builder;
-
-import java.lang.annotation.Annotation;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.beans.info.spi.BeanAccessMode;
-import org.jboss.beans.metadata.api.model.AutowireType;
-import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
-import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
-import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
-import org.jboss.beans.metadata.spi.ValueMetaData;
-import org.jboss.beans.metadata.spi.RelatedClassMetaData;
-import org.jboss.dependency.spi.Cardinality;
-import org.jboss.dependency.spi.ControllerMode;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.dependency.spi.ErrorHandlingMode;
-
-/**
- * BeanMetaDataBuilder contract.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
- */
-public abstract class BeanMetaDataBuilder
-{
- /**
- * Create builder from bean.
- *
- * @param bean bean class name
- * @return new Builder
- */
- public static BeanMetaDataBuilder createBuilder(String bean)
- {
- return BeanMetaDataBuilderFactory.createBuilder(bean);
- }
-
- /**
- * Create builder from name and bean.
- *
- * @param name bean name
- * @param bean bean class name
- * @return new Builder
- */
- public static BeanMetaDataBuilder createBuilder(String name, String bean)
- {
- return BeanMetaDataBuilderFactory.createBuilder(name, bean);
- }
-
- /**
- * Create builder from BeanMetaData
- *
- * @param beanMetaData the bean metadata
- * @return new Builder()
- */
- public static BeanMetaDataBuilder createBuilder(BeanMetaData beanMetaData)
- {
- if (beanMetaData instanceof AbstractBeanMetaData)
- {
- return BeanMetaDataBuilderFactory.createBuilder((AbstractBeanMetaData)beanMetaData);
- }
- else
- throw new IllegalArgumentException("Invalid type of bean metadata");
- }
-
- /**
- * Get the constructed bean metadata
- *
- * @return the bean metadata
- */
- public abstract BeanMetaData getBeanMetaData();
-
- /**
- * Get bean factory from underlying bean meta data.
- *
- * Note: this one includes all nested beans from
- * underlying bean metadata.
- *
- * @return bean meta data factory
- */
- public abstract BeanMetaDataFactory getBeanMetaDataFactory();
-
- /**
- * Get underlying bean as BeanMetaDataFactory.
- *
- * Note: this method doesn't include nested beans from
- * underlying bean metadata.
- *
- * @return bean meta data factory
- */
- public BeanMetaDataFactory asBeanMetaDataFactory()
- {
- return new BeanMetaDataFactory()
- {
- public List<BeanMetaData> getBeans()
- {
- return Collections.singletonList(getBeanMetaData());
- }
- };
- }
-
- /**
- * Set the bean name.
- *
- * @param name the name
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setName(String name);
-
- /**
- * Set the bean.
- *
- * @param bean the bean class name
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setBean(String bean);
-
- /**
- * Set the aliases
- *
- * @param aliases the aliases
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setAliases(Set<Object> aliases);
-
- /**
- * Add related class.
- *
- * @param className the related class name
- * @param enabled the enabled
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addRelatedClass(String className, Object... enabled);
-
- /**
- * Add related class.
- *
- * @param related the related class
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addRelatedClass(RelatedClassMetaData related);
-
- /**
- * Set the related
- *
- * @param related the related
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setRelated(Set<RelatedClassMetaData> related);
-
- /**
- * Add alias.
- *
- * @param alias the alias
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addAlias(Object alias);
-
- /**
- * Set the annotations
- *
- * @param annotations the annotations
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setAnnotations(Set<String> annotations);
-
- /**
- * Add annotation.
- *
- * @param annotation the annotation
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addAnnotation(String annotation);
-
- /**
- * Add annotation.
- *
- * @param annotation the annotation
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addAnnotation(Annotation annotation);
-
- /**
- * Add annotation.
- *
- * @param annotation the annotation
- * @param replace the replace flag
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addAnnotation(String annotation, boolean replace);
-
- /**
- * Set the mode
- *
- * @param modeString the mode
- * @return the builder
- */
- public BeanMetaDataBuilder setMode(String modeString)
- {
- return setMode(ControllerMode.getInstance(modeString));
- }
-
- /**
- * Set the mode
- *
- * @param mode the mode
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setMode(ControllerMode mode);
-
- /**
- * Set the access mode
- *
- * @param mode the access mode
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setAccessMode(BeanAccessMode mode);
-
- /**
- * Set the error handling mode
- *
- * @param mode the error handling mode
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setErrorHandlingMode(ErrorHandlingMode mode);
-
- /**
- * Set the autowire type
- *
- * @param type the autowire type
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setAutowireType(AutowireType type);
-
- /**
- * Is bean autowire candidate.
- *
- * @param candidate the candidate flag
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setAutowireCandidate(boolean candidate);
-
- /**
- * Set that we don't want to use the deployment classloader
- *
- * @return the builder
- */
-
- public BeanMetaDataBuilder setNoClassLoader()
- {
- return setClassLoader(createNull());
- }
-
- /**
- * Set the classloader
- *
- * @param classLoader the classloader
- * @return the builder
- */
- public BeanMetaDataBuilder setClassLoader(Object classLoader)
- {
- return setClassLoader(createValue(classLoader));
- }
-
- /**
- * Set the classloader
- *
- * @param classLoader the classloader
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setClassLoader(ValueMetaData classLoader);
-
- /**
- * Set the classloader
- *
- * @param classLoader the classloader
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setClassLoader(ClassLoaderMetaData classLoader);
-
- /**
- * Set the factory
- *
- * @param factory the factory
- * @return the builder
- */
- public BeanMetaDataBuilder setFactory(Object factory)
- {
- return setFactory(createValue(factory));
- }
-
- /**
- * Set the factory
- *
- * @param bean the bean name
- * @return the builder
- */
- public BeanMetaDataBuilder setFactory(String bean)
- {
- return setFactory(bean, null);
- }
-
- /**
- * Set the factory
- *
- * @param bean the bean name
- * @param property the property name for the factory
- * @return the builder
- */
- public BeanMetaDataBuilder setFactory(String bean, String property)
- {
- return setFactory(createInject(bean, property));
- }
-
- /**
- * Set the factory
- *
- * @param factory the factory
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setFactory(ValueMetaData factory);
-
- /**
- * Set the factory class
- *
- * @param factoryClass the factory class
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setFactoryClass(String factoryClass);
-
- /**
- * Set the factory method
- *
- * @param factoryMethod the factory method
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setFactoryMethod(String factoryMethod);
-
- /**
- * Set the constructor value
- *
- * @param value the object "constructed"
- * @return the builder
- */
-
- public BeanMetaDataBuilder setConstructorValue(Object value)
- {
- return setConstructorValue(createValue(value));
- }
-
- /**
- * Set the constructor value
- *
- * @param type the type
- * @param value the object "constructed"
- * @return the builder
- */
-
- public BeanMetaDataBuilder setConstructorValue(String type, String value)
- {
- return setConstructorValue(createString(type, value));
- }
-
- /**
- * Set the constructor value
- *
- * @param value the object "constructed"
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setConstructorValue(ValueMetaData value);
-
- /**
- * Add a constructor parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addConstructorParameter(String type, Object value);
-
- /**
- * Add a constructor parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addConstructorParameter(String type, String value);
-
- /**
- * Add a constructor parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addConstructorParameter(String type, ValueMetaData value);
-
- /**
- * Add a property, replace it if it already exists
- *
- * @param name the property name
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addPropertyMetaData(String name, Object value);
-
- /**
- * Add a property, replace it if it already exists
- *
- * @param name the property name
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addPropertyMetaData(String name, String value);
-
- /**
- * Add a property, replace it if it already exists
- *
- * @param name the property name
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addPropertyMetaData(String name, ValueMetaData value);
-
- /**
- * Add a property, replace it if it already exists
- *
- * @param name the property name
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addPropertyMetaData(String name, Collection<ValueMetaData> value);
-
- /**
- * Add a property, replace it if it already exists
- *
- * @param name the property name
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addPropertyMetaData(String name, Map<ValueMetaData, ValueMetaData> value);
-
- /**
- * Should we ignore default create invocation.
- *
- * @return the builder
- */
- public abstract BeanMetaDataBuilder ignoreCreate();
-
- /**
- * Set the create method
- *
- * @param methodName the method name
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setCreate(String methodName);
-
- /**
- * Add a create parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addCreateParameter(String type, Object value);
-
- /**
- * Add a create parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addCreateParameter(String type, String value);
-
- /**
- * Add a create parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addCreateParameter(String type, ValueMetaData value);
-
- /**
- * Should we ignore default start invocation.
- *
- * @return the builder
- */
- public abstract BeanMetaDataBuilder ignoreStart();
-
- /**
- * Set the start method
- *
- * @param methodName the method name
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setStart(String methodName);
-
- /**
- * Add a start parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addStartParameter(String type, Object value);
-
- /**
- * Add a start parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addStartParameter(String type, String value);
-
- /**
- * Add a start parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addStartParameter(String type, ValueMetaData value);
-
- /**
- * Should we ignore default stop invocation.
- *
- * @return the builder
- */
- public abstract BeanMetaDataBuilder ignoreStop();
-
- /**
- * Set the stop method
- *
- * @param methodName the method name
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setStop(String methodName);
-
- /**
- * Add a stop parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addStopParameter(String type, Object value);
-
- /**
- * Add a stop parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addStopParameter(String type, String value);
-
- /**
- * Add a stop parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addStopParameter(String type, ValueMetaData value);
-
- /**
- * Should we ignore default destroy invocation.
- *
- * @return the builder
- */
- public abstract BeanMetaDataBuilder ignoreDestroy();
-
- /**
- * Set the destroy method
- *
- * @param methodName the method name
- * @return the builder
- */
- public abstract BeanMetaDataBuilder setDestroy(String methodName);
-
- /**
- * Add a destroy parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addDestroyParameter(String type, Object value);
-
- /**
- * Add a destroy parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addDestroyParameter(String type, String value);
-
- /**
- * Add a destroy parameter
- *
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addDestroyParameter(String type, ValueMetaData value);
-
- /**
- * Add a supply
- *
- * @param supply the supply
- * @return the builder
- */
- public BeanMetaDataBuilder addSupply(Object supply)
- {
- return addSupply(supply, null);
- }
-
- /**
- * Add a supply
- *
- * @param supply the supply
- * @param type the supply type
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addSupply(Object supply, String type);
-
- /**
- * Add a demand
- *
- * @param demand the demand
- * @return the builder
- */
- public BeanMetaDataBuilder addDemand(Object demand)
- {
- return addDemand(demand, (ControllerState) null, null);
- }
-
- /**
- * Add a demand
- *
- * @param demand the demand
- * @param whenRequired when the demand is required
- * @param transformer the transformer
- * @return the builder
- */
- public BeanMetaDataBuilder addDemand(Object demand, String whenRequired, String transformer)
- {
- ControllerState whenRequiredState = null;
- if (whenRequired != null)
- whenRequiredState = new ControllerState(whenRequired);
- return addDemand(demand, whenRequiredState, transformer);
- }
-
- /**
- * Add a demand
- *
- * @param demand the demand
- * @param whenRequired when the demand is required
- * @param transformer the transformer
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addDemand(Object demand, ControllerState whenRequired, String transformer);
-
- /**
- * Add a dependency
- *
- * @param dependency the dependency
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addDependency(Object dependency);
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName)
- {
- return addInstall(methodName, null);
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String type, Object value)
- {
- return addInstall(methodName, null, type, value);
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String type, String value)
- {
- return addInstall(methodName, null, type, value);
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String type, ValueMetaData value)
- {
- return addInstall(methodName, null, type, value);
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param types the parameter types
- * @param values the values
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String[] types, Object[] values)
- {
- return addInstall(methodName, null, types, values);
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param types the parameter types
- * @param values the values
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String[] types, String[] values)
- {
- return addInstall(methodName, null, types, values);
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param types the parameter types
- * @param values the values
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String[] types, ValueMetaData[] values)
- {
- return addInstall(methodName, null, types, values);
- }
-
- /**
- * Add an install with a this parameter
- *
- * @param methodName the method name
- * @param bean the bean name
- * @return the builder
- */
- public BeanMetaDataBuilder addInstallWithThis(String methodName, String bean)
- {
- return addInstallWithThis(methodName, bean, null);
- }
-
- /**
- * Add an install with a this parameter
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param state the state of the bean
- * @return the builder
- */
- public BeanMetaDataBuilder addInstallWithThis(String methodName, String bean, ControllerState state)
- {
- return addInstallWithThis(methodName, bean, state, null);
- }
-
- /**
- * Add an install with a this parameter
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param state the state of the bean
- * @param whenRequired the state when to install
- * @return the builder
- */
- public BeanMetaDataBuilder addInstallWithThis(String methodName, String bean, ControllerState state, ControllerState whenRequired)
- {
- ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean, state, whenRequired);
- parameters.addParameterMetaData(null, createThis());
- return this;
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param bean the bean name
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String bean)
- {
- addInstallWithParameters(methodName, bean);
- return this;
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String bean, String type, Object value)
- {
- ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean);
- parameters.addParameterMetaData(type, value);
- return this;
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String bean, String type, String value)
- {
- ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean);
- parameters.addParameterMetaData(type, value);
- return this;
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String bean, String type, ValueMetaData value)
- {
- ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean);
- parameters.addParameterMetaData(type, value);
- return this;
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param types the parameter types
- * @param values the values
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String bean, String[] types, Object[] values)
- {
- ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean);
- for (int i = 0; i < types.length; i++)
- parameters.addParameterMetaData(types[i], values[i]);
- return this;
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param types the parameter types
- * @param values the values
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String bean, String[] types, String[] values)
- {
- ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean);
- for (int i = 0; i < types.length; i++)
- parameters.addParameterMetaData(types[i], values[i]);
- return this;
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param types the parameter types
- * @param values the values
- * @return the builder
- */
- public BeanMetaDataBuilder addInstall(String methodName, String bean, String[] types, ValueMetaData[] values)
- {
- ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean);
- for (int i = 0; i < types.length; i++)
- parameters.addParameterMetaData(types[i], values[i]);
- return this;
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @return the builder
- */
- public ParameterMetaDataBuilder addInstallWithParameters(String methodName)
- {
- return addInstallWithParameters(methodName, null);
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param bean the bean name
- * @return the builder
- */
- public ParameterMetaDataBuilder addInstallWithParameters(String methodName, String bean)
- {
- return addInstallWithParameters(methodName, bean, null);
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param state the state of the bean
- * @return the parameter builder
- */
- public ParameterMetaDataBuilder addInstallWithParameters(String methodName, String bean, ControllerState state)
- {
- return addInstallWithParameters(methodName, bean, state, null);
- }
-
- /**
- * Add an install
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param state the state of the bean
- * @param whenRequired the state when to install
- * @return the parameter builder
- */
- public abstract ParameterMetaDataBuilder addInstallWithParameters(String methodName, String bean, ControllerState state, ControllerState whenRequired);
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName)
- {
- return addUninstall(methodName, null);
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String type, Object value)
- {
- return addUninstall(methodName, null, type, value);
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String type, String value)
- {
- return addUninstall(methodName, null, type, value);
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String type, ValueMetaData value)
- {
- return addUninstall(methodName, null, type, value);
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param types the parameter types
- * @param values the values
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String[] types, Object[] values)
- {
- return addUninstall(methodName, null, types, values);
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param types the parameter types
- * @param values the values
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String[] types, String[] values)
- {
- return addUninstall(methodName, null, types, values);
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param types the parameter types
- * @param values the values
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String[] types, ValueMetaData[] values)
- {
- return addUninstall(methodName, null, types, values);
- }
-
- /**
- * Add an uninstall with a this parameter
- *
- * @param methodName the method name
- * @param bean the bean name
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstallWithThis(String methodName, String bean)
- {
- return addUninstallWithThis(methodName, bean, null);
- }
-
- /**
- * Add an uninstall with a this parameter
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param state the state when to uninstall
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstallWithThis(String methodName, String bean, ControllerState state)
- {
- return addUninstallWithThis(methodName, bean, state, null);
- }
-
- /**
- * Add an uninstall with a this parameter
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param state the state of the bean
- * @param whenRequired the state when to uninstall
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstallWithThis(String methodName, String bean, ControllerState state, ControllerState whenRequired)
- {
- ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean, state, whenRequired);
- parameters.addParameterMetaData(null, createThis());
- return this;
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param bean the bean name
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String bean)
- {
- addUninstallWithParameters(methodName, bean);
- return this;
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String bean, String type, Object value)
- {
- ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean);
- parameters.addParameterMetaData(type, value);
- return this;
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String bean, String type, String value)
- {
- ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean);
- parameters.addParameterMetaData(type, value);
- return this;
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param type the parameter type
- * @param value the value
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String bean, String type, ValueMetaData value)
- {
- ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean);
- parameters.addParameterMetaData(type, value);
- return this;
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param types the parameter types
- * @param values the values
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String bean, String[] types, Object[] values)
- {
- ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean);
- for (int i = 0; i < types.length; ++i)
- parameters.addParameterMetaData(types[i], values[i]);
- return this;
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param types the parameter types
- * @param values the values
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String bean, String[] types, String[] values)
- {
- ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean);
- for (int i = 0; i < types.length; ++i)
- parameters.addParameterMetaData(types[i], values[i]);
- return this;
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param types the parameter types
- * @param values the values
- * @return the builder
- */
- public BeanMetaDataBuilder addUninstall(String methodName, String bean, String[] types, ValueMetaData[] values)
- {
- ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean);
- for (int i = 0; i < types.length; ++i)
- parameters.addParameterMetaData(types[i], values[i]);
- return this;
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @return the builder
- */
- public ParameterMetaDataBuilder addUninstallWithParameters(String methodName)
- {
- return addUninstallWithParameters(methodName, null);
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param bean the bean name
- * @return the builder
- */
- public ParameterMetaDataBuilder addUninstallWithParameters(String methodName, String bean)
- {
- return addUninstallWithParameters(methodName, bean, null);
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param state the state of the bean
- * @return the parameter builder
- */
- public ParameterMetaDataBuilder addUninstallWithParameters(String methodName, String bean, ControllerState state)
- {
- return addUninstallWithParameters(methodName, bean, state, null);
- }
-
- /**
- * Add an uninstall
- *
- * @param methodName the method name
- * @param bean the bean name
- * @param state the state of the bean
- * @param whenRequired the state when to uninstall
- * @return the parameter builder
- */
- public abstract ParameterMetaDataBuilder addUninstallWithParameters(String methodName, String bean, ControllerState state, ControllerState whenRequired);
-
- /**
- * Add property install callback.
- *
- * @param property the property name
- * @return the builder
- */
- public BeanMetaDataBuilder addPropertyInstallCallback(String property)
- {
- return addPropertyInstallCallback(property, null, null);
- }
-
- /**
- * Add property install callback.
- *
- * @param property the property name
- * @param whenRequired the when required state
- * @return the builder
- */
- public BeanMetaDataBuilder addPropertyInstallCallback(String property, ControllerState whenRequired)
- {
- return addPropertyInstallCallback(property, whenRequired, null);
- }
-
- /**
- * Add property install callback.
- *
- * @param property the property name
- * @param cardinality the cardinality
- * @return the builder
- */
- public BeanMetaDataBuilder addPropertyInstallCallback(String property, Cardinality cardinality)
- {
- return addPropertyInstallCallback(property, null, cardinality);
- }
-
- /**
- * Add property install callback.
- *
- * @param property the property name
- * @param whenRequired the when required state
- * @param cardinality the cardinality
- * @return the builder
- */
- public BeanMetaDataBuilder addPropertyInstallCallback(String property, ControllerState whenRequired, Cardinality cardinality)
- {
- return addPropertyInstallCallback(property, null, whenRequired, null, cardinality);
- }
-
- /**
- * Add property install callback.
- *
- * @param property the property name
- * @param signature the property signature
- * @param whenRequired the when required state
- * @param dependentState the dependant state
- * @param cardinality the cardinality
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addPropertyInstallCallback(
- String property,
- String signature,
- ControllerState whenRequired,
- ControllerState dependentState,
- Cardinality cardinality);
-
- /**
- * Add property uninstall callback.
- *
- * @param property the property name
- * @return the builder
- */
- public BeanMetaDataBuilder addPropertyUninstallCallback(String property)
- {
- return addPropertyUninstallCallback(property, null, null);
- }
-
- /**
- * Add property uninstall callback.
- *
- * @param property the property name
- * @param whenRequired the when required state
- * @return the builder
- */
- public BeanMetaDataBuilder addPropertyUninstallCallback(String property, ControllerState whenRequired)
- {
- return addPropertyUninstallCallback(property, whenRequired, null);
- }
-
- /**
- * Add property uninstall callback.
- *
- * @param property the property name
- * @param cardinality the cardinality
- * @return the builder
- */
- public BeanMetaDataBuilder addPropertyUninstallCallback(String property, Cardinality cardinality)
- {
- return addPropertyUninstallCallback(property, null, cardinality);
- }
-
- /**
- * Add property uninstall callback.
- *
- * @param property the property name
- * @param whenRequired the when required state
- * @param cardinality the cardinality
- * @return the builder
- */
- public BeanMetaDataBuilder addPropertyUninstallCallback(String property, ControllerState whenRequired, Cardinality cardinality)
- {
- return addPropertyUninstallCallback(property, null, whenRequired, null, cardinality);
- }
-
- /**
- * Add property uninstall callback.
- *
- * @param property the property name
- * @param signature the property signature
- * @param whenRequired the when required state
- * @param dependentState the dependant state
- * @param cardinality the cardinality
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addPropertyUninstallCallback(
- String property,
- String signature,
- ControllerState whenRequired,
- ControllerState dependentState,
- Cardinality cardinality);
-
- /**
- * Add method install callback.
- *
- * @param method the method name
- * @return the builder
- */
- public BeanMetaDataBuilder addMethodInstallCallback(String method)
- {
- return addMethodInstallCallback(method, null, null);
- }
-
- /**
- * Add method install callback.
- *
- * @param method the method name
- * @param whenRequired the when required state
- * @return the builder
- */
- public BeanMetaDataBuilder addMethodInstallCallback(String method, ControllerState whenRequired)
- {
- return addMethodInstallCallback(method, whenRequired, null);
- }
-
- /**
- * Add method install callback.
- *
- * @param method the method name
- * @param cardinality the cardinality
- * @return the builder
- */
- public BeanMetaDataBuilder addMethodInstallCallback(String method, Cardinality cardinality)
- {
- return addMethodInstallCallback(method, null, cardinality);
- }
-
- /**
- * Add method install callback.
- *
- * @param method the method name
- * @param whenRequired the when required state
- * @param cardinality the cardinality
- * @return the builder
- */
- public BeanMetaDataBuilder addMethodInstallCallback(String method, ControllerState whenRequired, Cardinality cardinality)
- {
- return addMethodInstallCallback(method, null, whenRequired, null, cardinality);
- }
-
- /**
- * Add method install callback.
- *
- * @param method the method name
- * @param signature the method signature
- * @param whenRequired the when required state
- * @param dependentState the dependant state
- * @param cardinality the cardinality
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addMethodInstallCallback(
- String method,
- String signature,
- ControllerState whenRequired,
- ControllerState dependentState,
- Cardinality cardinality);
-
- /**
- * Add method uninstall callback.
- *
- * @param method the method name
- * @return the builder
- */
- public BeanMetaDataBuilder addMethodUninstallCallback(String method)
- {
- return addMethodUninstallCallback(method, null, null);
- }
-
- /**
- * Add method uninstall callback.
- *
- * @param method the method name
- * @param whenRequired the when required state
- * @return the builder
- */
- public BeanMetaDataBuilder addMethodUninstallCallback(String method, ControllerState whenRequired)
- {
- return addMethodUninstallCallback(method, whenRequired, null);
- }
-
- /**
- * Add method uninstall callback.
- *
- * @param method the method name
- * @param cardinality the cardinality
- * @return the builder
- */
- public BeanMetaDataBuilder addMethodUninstallCallback(String method, Cardinality cardinality)
- {
- return addMethodUninstallCallback(method, null, cardinality);
- }
-
- /**
- * Add method uninstall callback.
- *
- * @param method the method name
- * @param whenRequired the when required state
- * @param cardinality the cardinality
- * @return the builder
- */
- public BeanMetaDataBuilder addMethodUninstallCallback(String method, ControllerState whenRequired, Cardinality cardinality)
- {
- return addMethodUninstallCallback(method, null, whenRequired, null, cardinality);
- }
-
- /**
- * Add method uninstall callback.
- *
- * @param method the method name
- * @param signature the method signature
- * @param whenRequired the when required state
- * @param dependentState the dependant state
- * @param cardinality the cardinality
- * @return the builder
- */
- public abstract BeanMetaDataBuilder addMethodUninstallCallback(
- String method,
- String signature,
- ControllerState whenRequired,
- ControllerState dependentState,
- Cardinality cardinality);
-
- /**
- * Create related class name.
- *
- * @param className the related class name
- * @param enabled the enabled
- * @return new related class meta data
- */
- public abstract RelatedClassMetaData createRelated(String className, Object... enabled);
-
- /**
- * Create a null value
- *
- * @return the null value
- */
- public abstract ValueMetaData createNull();
-
- /**
- * Create a this value
- *
- * @return the this value
- */
- public abstract ValueMetaData createThis();
-
- /**
- * Create a value
- *
- * @param value the already constructed value
- * @return the value
- */
- public abstract ValueMetaData createValue(Object value);
-
- /**
- * Create a string value
- *
- * @param type the type to be converted into
- * @param value the value
- * @return the string value
- */
- public abstract ValueMetaData createString(String type, String value);
-
- /**
- * Create an injection
- *
- * @param bean the bean to inject
- * @return the injection
- */
- public ValueMetaData createInject(Object bean)
- {
- return createInject(bean, null, null, null);
- }
-
- /**
- * Create an injection
- *
- * @param bean the bean to inject
- * @param property the property of the bean
- * @return the injection
- */
- public ValueMetaData createInject(Object bean, String property)
- {
- return createInject(bean, property, null, null);
- }
-
- /**
- * Create an injection
- *
- * @param bean the bean to inject
- * @param property the property of the bean
- * @param whenRequired when the injection is required
- * @param dependentState the state of the injected bean
- * @return the injection
- */
- public abstract ValueMetaData createInject(Object bean, String property, ControllerState whenRequired, ControllerState dependentState);
-
- /**
- * Create a new collection
- *
- * @return the collection
- */
- public Collection<ValueMetaData> createCollection()
- {
- return createCollection(null, null);
- }
-
- /**
- * Create a new collection
- *
- * @param collectionType the collection type
- * @param elementType the element type
- * @return the collection
- */
- public abstract Collection<ValueMetaData> createCollection(String collectionType, String elementType);
-
- /**
- * Create a new list
- *
- * @return the list
- */
- public List<ValueMetaData> createList()
- {
- return createList(null, null);
- }
-
- /**
- * Create a new list
- *
- * @param listType the list type
- * @param elementType the element type
- * @return the list
- */
- public abstract List<ValueMetaData> createList(String listType, String elementType);
-
- /**
- * Create a new set
- *
- * @return the set
- */
- public Set<ValueMetaData> createSet()
- {
- return createSet(null, null);
- }
-
- /**
- * Create a new set
- *
- * @param setType the set type
- * @param elementType the element type
- * @return the set
- */
- public abstract Set<ValueMetaData> createSet(String setType, String elementType);
-
- /**
- * Create a new array
- *
- * @return the array
- */
- public List<ValueMetaData> createArray()
- {
- return createArray(null, null);
- }
-
- /**
- * Create a new array
- *
- * @param arrayType the array type
- * @param elementType the element type
- * @return the set
- */
- public abstract List<ValueMetaData> createArray(String arrayType, String elementType);
-
- /**
- * Create a new map
- *
- * @return the map
- */
- public Map<ValueMetaData, ValueMetaData> createMap()
- {
- return createMap(null, null, null);
- }
-
- /**
- * Create a new map
- *
- * @param mapType the map type
- * @param keyType the key type
- * @param valueType the value type
- * @return the map
- */
- public abstract Map<ValueMetaData, ValueMetaData> createMap(String mapType, String keyType, String valueType);
-}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/main/java/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,1744 @@
+/*
+* 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.beans.metadata.spi.builder;
+
+import java.lang.annotation.Annotation;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.beans.info.spi.BeanAccessMode;
+import org.jboss.beans.metadata.api.model.AutowireType;
+import org.jboss.beans.metadata.api.model.InjectOption;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.beans.metadata.spi.RelatedClassMetaData;
+import org.jboss.dependency.spi.Cardinality;
+import org.jboss.dependency.spi.ControllerMode;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.ErrorHandlingMode;
+
+/**
+ * BeanMetaDataBuilder contract.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ */
+public abstract class BeanMetaDataBuilder
+{
+ /**
+ * Create builder from bean.
+ *
+ * @param bean bean class name
+ * @return new Builder
+ */
+ public static BeanMetaDataBuilder createBuilder(String bean)
+ {
+ return BeanMetaDataBuilderFactory.createBuilder(bean);
+ }
+
+ /**
+ * Create builder from name and bean.
+ *
+ * @param name bean name
+ * @param bean bean class name
+ * @return new Builder
+ */
+ public static BeanMetaDataBuilder createBuilder(String name, String bean)
+ {
+ return BeanMetaDataBuilderFactory.createBuilder(name, bean);
+ }
+
+ /**
+ * Create builder from BeanMetaData
+ *
+ * @param beanMetaData the bean metadata
+ * @return new Builder()
+ */
+ public static BeanMetaDataBuilder createBuilder(BeanMetaData beanMetaData)
+ {
+ if (beanMetaData instanceof AbstractBeanMetaData)
+ {
+ return BeanMetaDataBuilderFactory.createBuilder((AbstractBeanMetaData)beanMetaData);
+ }
+ else
+ throw new IllegalArgumentException("Invalid type of bean metadata");
+ }
+
+ /**
+ * Get the constructed bean metadata
+ *
+ * @return the bean metadata
+ */
+ public abstract BeanMetaData getBeanMetaData();
+
+ /**
+ * Get bean factory from underlying bean meta data.
+ *
+ * Note: this one includes all nested beans from
+ * underlying bean metadata.
+ *
+ * @return bean meta data factory
+ */
+ public abstract BeanMetaDataFactory getBeanMetaDataFactory();
+
+ /**
+ * Get underlying bean as BeanMetaDataFactory.
+ *
+ * Note: this method doesn't include nested beans from
+ * underlying bean metadata.
+ *
+ * @return bean meta data factory
+ */
+ public BeanMetaDataFactory asBeanMetaDataFactory()
+ {
+ return new BeanMetaDataFactory()
+ {
+ public List<BeanMetaData> getBeans()
+ {
+ return Collections.singletonList(getBeanMetaData());
+ }
+ };
+ }
+
+ /**
+ * Set the bean name.
+ *
+ * @param name the name
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setName(String name);
+
+ /**
+ * Set the bean.
+ *
+ * @param bean the bean class name
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setBean(String bean);
+
+ /**
+ * Set the aliases
+ *
+ * @param aliases the aliases
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setAliases(Set<Object> aliases);
+
+ /**
+ * Add related class.
+ *
+ * @param className the related class name
+ * @param enabled the enabled
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addRelatedClass(String className, Object... enabled);
+
+ /**
+ * Add related class.
+ *
+ * @param related the related class
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addRelatedClass(RelatedClassMetaData related);
+
+ /**
+ * Set the related
+ *
+ * @param related the related
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setRelated(Set<RelatedClassMetaData> related);
+
+ /**
+ * Add alias.
+ *
+ * @param alias the alias
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addAlias(Object alias);
+
+ /**
+ * Set the annotations
+ *
+ * @param annotations the annotations
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setAnnotations(Set<String> annotations);
+
+ /**
+ * Add annotation.
+ *
+ * @param annotation the annotation
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addAnnotation(String annotation);
+
+ /**
+ * Add annotation.
+ *
+ * @param annotation the annotation
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addAnnotation(Annotation annotation);
+
+ /**
+ * Add annotation.
+ *
+ * @param annotation the annotation
+ * @param replace the replace flag
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addAnnotation(String annotation, boolean replace);
+
+ /**
+ * Set the mode
+ *
+ * @param modeString the mode
+ * @return the builder
+ */
+ public BeanMetaDataBuilder setMode(String modeString)
+ {
+ return setMode(ControllerMode.getInstance(modeString));
+ }
+
+ /**
+ * Set the mode
+ *
+ * @param mode the mode
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setMode(ControllerMode mode);
+
+ /**
+ * Set the access mode
+ *
+ * @param mode the access mode
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setAccessMode(BeanAccessMode mode);
+
+ /**
+ * Set the error handling mode
+ *
+ * @param mode the error handling mode
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setErrorHandlingMode(ErrorHandlingMode mode);
+
+ /**
+ * Set the autowire type
+ *
+ * @param type the autowire type
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setAutowireType(AutowireType type);
+
+ /**
+ * Is bean autowire candidate.
+ *
+ * @param candidate the candidate flag
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setAutowireCandidate(boolean candidate);
+
+ /**
+ * Set that we don't want to use the deployment classloader
+ *
+ * @return the builder
+ */
+
+ public BeanMetaDataBuilder setNoClassLoader()
+ {
+ return setClassLoader(createNull());
+ }
+
+ /**
+ * Set the classloader
+ *
+ * @param classLoader the classloader
+ * @return the builder
+ */
+ public BeanMetaDataBuilder setClassLoader(Object classLoader)
+ {
+ return setClassLoader(createValue(classLoader));
+ }
+
+ /**
+ * Set the classloader
+ *
+ * @param classLoader the classloader
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setClassLoader(ValueMetaData classLoader);
+
+ /**
+ * Set the classloader
+ *
+ * @param classLoader the classloader
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setClassLoader(ClassLoaderMetaData classLoader);
+
+ /**
+ * Set the factory
+ *
+ * @param factory the factory
+ * @return the builder
+ */
+ public BeanMetaDataBuilder setFactory(Object factory)
+ {
+ return setFactory(createValue(factory));
+ }
+
+ /**
+ * Set the factory
+ *
+ * @param bean the bean name
+ * @return the builder
+ */
+ public BeanMetaDataBuilder setFactory(String bean)
+ {
+ return setFactory(bean, null);
+ }
+
+ /**
+ * Set the factory
+ *
+ * @param bean the bean name
+ * @param property the property name for the factory
+ * @return the builder
+ */
+ public BeanMetaDataBuilder setFactory(String bean, String property)
+ {
+ return setFactory(createInject(bean, property));
+ }
+
+ /**
+ * Set the factory
+ *
+ * @param factory the factory
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setFactory(ValueMetaData factory);
+
+ /**
+ * Set the factory class
+ *
+ * @param factoryClass the factory class
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setFactoryClass(String factoryClass);
+
+ /**
+ * Set the factory method
+ *
+ * @param factoryMethod the factory method
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setFactoryMethod(String factoryMethod);
+
+ /**
+ * Set the constructor value
+ *
+ * @param value the object "constructed"
+ * @return the builder
+ */
+
+ public BeanMetaDataBuilder setConstructorValue(Object value)
+ {
+ return setConstructorValue(createValue(value));
+ }
+
+ /**
+ * Set the constructor value
+ *
+ * @param type the type
+ * @param value the object "constructed"
+ * @return the builder
+ */
+
+ public BeanMetaDataBuilder setConstructorValue(String type, String value)
+ {
+ return setConstructorValue(createString(type, value));
+ }
+
+ /**
+ * Set the constructor value
+ *
+ * @param value the object "constructed"
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setConstructorValue(ValueMetaData value);
+
+ /**
+ * Add a constructor parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addConstructorParameter(String type, Object value);
+
+ /**
+ * Add a constructor parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addConstructorParameter(String type, String value);
+
+ /**
+ * Add a constructor parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addConstructorParameter(String type, ValueMetaData value);
+
+ /**
+ * Add a property, replace it if it already exists
+ *
+ * @param name the property name
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addPropertyMetaData(String name, Object value);
+
+ /**
+ * Add a property, replace it if it already exists
+ *
+ * @param name the property name
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addPropertyMetaData(String name, String value);
+
+ /**
+ * Add a property, replace it if it already exists
+ *
+ * @param name the property name
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addPropertyMetaData(String name, ValueMetaData value);
+
+ /**
+ * Add a property, replace it if it already exists
+ *
+ * @param name the property name
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addPropertyMetaData(String name, Collection<ValueMetaData> value);
+
+ /**
+ * Add a property, replace it if it already exists
+ *
+ * @param name the property name
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addPropertyMetaData(String name, Map<ValueMetaData, ValueMetaData> value);
+
+ /**
+ * Should we ignore default create invocation.
+ *
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder ignoreCreate();
+
+ /**
+ * Set the create method
+ *
+ * @param methodName the method name
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setCreate(String methodName);
+
+ /**
+ * Add a create parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addCreateParameter(String type, Object value);
+
+ /**
+ * Add a create parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addCreateParameter(String type, String value);
+
+ /**
+ * Add a create parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addCreateParameter(String type, ValueMetaData value);
+
+ /**
+ * Should we ignore default start invocation.
+ *
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder ignoreStart();
+
+ /**
+ * Set the start method
+ *
+ * @param methodName the method name
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setStart(String methodName);
+
+ /**
+ * Add a start parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addStartParameter(String type, Object value);
+
+ /**
+ * Add a start parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addStartParameter(String type, String value);
+
+ /**
+ * Add a start parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addStartParameter(String type, ValueMetaData value);
+
+ /**
+ * Should we ignore default stop invocation.
+ *
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder ignoreStop();
+
+ /**
+ * Set the stop method
+ *
+ * @param methodName the method name
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setStop(String methodName);
+
+ /**
+ * Add a stop parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addStopParameter(String type, Object value);
+
+ /**
+ * Add a stop parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addStopParameter(String type, String value);
+
+ /**
+ * Add a stop parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addStopParameter(String type, ValueMetaData value);
+
+ /**
+ * Should we ignore default destroy invocation.
+ *
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder ignoreDestroy();
+
+ /**
+ * Set the destroy method
+ *
+ * @param methodName the method name
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder setDestroy(String methodName);
+
+ /**
+ * Add a destroy parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addDestroyParameter(String type, Object value);
+
+ /**
+ * Add a destroy parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addDestroyParameter(String type, String value);
+
+ /**
+ * Add a destroy parameter
+ *
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addDestroyParameter(String type, ValueMetaData value);
+
+ /**
+ * Add a supply
+ *
+ * @param supply the supply
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addSupply(Object supply)
+ {
+ return addSupply(supply, null);
+ }
+
+ /**
+ * Add a supply
+ *
+ * @param supply the supply
+ * @param type the supply type
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addSupply(Object supply, String type);
+
+ /**
+ * Add a demand
+ *
+ * @param demand the demand
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addDemand(Object demand)
+ {
+ return addDemand(demand, (ControllerState) null, null);
+ }
+
+ /**
+ * Add a demand
+ *
+ * @param demand the demand
+ * @param whenRequired when the demand is required
+ * @param transformer the transformer
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addDemand(Object demand, String whenRequired, String transformer)
+ {
+ ControllerState whenRequiredState = null;
+ if (whenRequired != null)
+ whenRequiredState = new ControllerState(whenRequired);
+ return addDemand(demand, whenRequiredState, transformer);
+ }
+
+ /**
+ * Add a demand
+ *
+ * @param demand the demand
+ * @param whenRequired when the demand is required
+ * @param transformer the transformer
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addDemand(Object demand, ControllerState whenRequired, String transformer);
+
+ /**
+ * Add a dependency
+ *
+ * @param dependency the dependency
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addDependency(Object dependency);
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName)
+ {
+ return addInstall(methodName, null);
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String type, Object value)
+ {
+ return addInstall(methodName, null, type, value);
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String type, String value)
+ {
+ return addInstall(methodName, null, type, value);
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String type, ValueMetaData value)
+ {
+ return addInstall(methodName, null, type, value);
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param types the parameter types
+ * @param values the values
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String[] types, Object[] values)
+ {
+ return addInstall(methodName, null, types, values);
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param types the parameter types
+ * @param values the values
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String[] types, String[] values)
+ {
+ return addInstall(methodName, null, types, values);
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param types the parameter types
+ * @param values the values
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String[] types, ValueMetaData[] values)
+ {
+ return addInstall(methodName, null, types, values);
+ }
+
+ /**
+ * Add an install with a this parameter
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstallWithThis(String methodName, String bean)
+ {
+ return addInstallWithThis(methodName, bean, null);
+ }
+
+ /**
+ * Add an install with a this parameter
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param state the state of the bean
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstallWithThis(String methodName, String bean, ControllerState state)
+ {
+ return addInstallWithThis(methodName, bean, state, null);
+ }
+
+ /**
+ * Add an install with a this parameter
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param state the state of the bean
+ * @param whenRequired the state when to install
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstallWithThis(String methodName, String bean, ControllerState state, ControllerState whenRequired)
+ {
+ ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean, state, whenRequired);
+ parameters.addParameterMetaData(null, createThis());
+ return this;
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String bean)
+ {
+ addInstallWithParameters(methodName, bean);
+ return this;
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String bean, String type, Object value)
+ {
+ ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean);
+ parameters.addParameterMetaData(type, value);
+ return this;
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String bean, String type, String value)
+ {
+ ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean);
+ parameters.addParameterMetaData(type, value);
+ return this;
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String bean, String type, ValueMetaData value)
+ {
+ ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean);
+ parameters.addParameterMetaData(type, value);
+ return this;
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param types the parameter types
+ * @param values the values
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String bean, String[] types, Object[] values)
+ {
+ ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean);
+ for (int i = 0; i < types.length; i++)
+ parameters.addParameterMetaData(types[i], values[i]);
+ return this;
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param types the parameter types
+ * @param values the values
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String bean, String[] types, String[] values)
+ {
+ ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean);
+ for (int i = 0; i < types.length; i++)
+ parameters.addParameterMetaData(types[i], values[i]);
+ return this;
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param types the parameter types
+ * @param values the values
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addInstall(String methodName, String bean, String[] types, ValueMetaData[] values)
+ {
+ ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean);
+ for (int i = 0; i < types.length; i++)
+ parameters.addParameterMetaData(types[i], values[i]);
+ return this;
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @return the builder
+ */
+ public ParameterMetaDataBuilder addInstallWithParameters(String methodName)
+ {
+ return addInstallWithParameters(methodName, null);
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @return the builder
+ */
+ public ParameterMetaDataBuilder addInstallWithParameters(String methodName, String bean)
+ {
+ return addInstallWithParameters(methodName, bean, null);
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param state the state of the bean
+ * @return the parameter builder
+ */
+ public ParameterMetaDataBuilder addInstallWithParameters(String methodName, String bean, ControllerState state)
+ {
+ return addInstallWithParameters(methodName, bean, state, null);
+ }
+
+ /**
+ * Add an install
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param state the state of the bean
+ * @param whenRequired the state when to install
+ * @return the parameter builder
+ */
+ public abstract ParameterMetaDataBuilder addInstallWithParameters(String methodName, String bean, ControllerState state, ControllerState whenRequired);
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName)
+ {
+ return addUninstall(methodName, null);
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String type, Object value)
+ {
+ return addUninstall(methodName, null, type, value);
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String type, String value)
+ {
+ return addUninstall(methodName, null, type, value);
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String type, ValueMetaData value)
+ {
+ return addUninstall(methodName, null, type, value);
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param types the parameter types
+ * @param values the values
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String[] types, Object[] values)
+ {
+ return addUninstall(methodName, null, types, values);
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param types the parameter types
+ * @param values the values
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String[] types, String[] values)
+ {
+ return addUninstall(methodName, null, types, values);
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param types the parameter types
+ * @param values the values
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String[] types, ValueMetaData[] values)
+ {
+ return addUninstall(methodName, null, types, values);
+ }
+
+ /**
+ * Add an uninstall with a this parameter
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstallWithThis(String methodName, String bean)
+ {
+ return addUninstallWithThis(methodName, bean, null);
+ }
+
+ /**
+ * Add an uninstall with a this parameter
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param state the state when to uninstall
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstallWithThis(String methodName, String bean, ControllerState state)
+ {
+ return addUninstallWithThis(methodName, bean, state, null);
+ }
+
+ /**
+ * Add an uninstall with a this parameter
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param state the state of the bean
+ * @param whenRequired the state when to uninstall
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstallWithThis(String methodName, String bean, ControllerState state, ControllerState whenRequired)
+ {
+ ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean, state, whenRequired);
+ parameters.addParameterMetaData(null, createThis());
+ return this;
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String bean)
+ {
+ addUninstallWithParameters(methodName, bean);
+ return this;
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String bean, String type, Object value)
+ {
+ ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean);
+ parameters.addParameterMetaData(type, value);
+ return this;
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String bean, String type, String value)
+ {
+ ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean);
+ parameters.addParameterMetaData(type, value);
+ return this;
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param type the parameter type
+ * @param value the value
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String bean, String type, ValueMetaData value)
+ {
+ ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean);
+ parameters.addParameterMetaData(type, value);
+ return this;
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param types the parameter types
+ * @param values the values
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String bean, String[] types, Object[] values)
+ {
+ ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean);
+ for (int i = 0; i < types.length; ++i)
+ parameters.addParameterMetaData(types[i], values[i]);
+ return this;
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param types the parameter types
+ * @param values the values
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String bean, String[] types, String[] values)
+ {
+ ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean);
+ for (int i = 0; i < types.length; ++i)
+ parameters.addParameterMetaData(types[i], values[i]);
+ return this;
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param types the parameter types
+ * @param values the values
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addUninstall(String methodName, String bean, String[] types, ValueMetaData[] values)
+ {
+ ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean);
+ for (int i = 0; i < types.length; ++i)
+ parameters.addParameterMetaData(types[i], values[i]);
+ return this;
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @return the builder
+ */
+ public ParameterMetaDataBuilder addUninstallWithParameters(String methodName)
+ {
+ return addUninstallWithParameters(methodName, null);
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @return the builder
+ */
+ public ParameterMetaDataBuilder addUninstallWithParameters(String methodName, String bean)
+ {
+ return addUninstallWithParameters(methodName, bean, null);
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param state the state of the bean
+ * @return the parameter builder
+ */
+ public ParameterMetaDataBuilder addUninstallWithParameters(String methodName, String bean, ControllerState state)
+ {
+ return addUninstallWithParameters(methodName, bean, state, null);
+ }
+
+ /**
+ * Add an uninstall
+ *
+ * @param methodName the method name
+ * @param bean the bean name
+ * @param state the state of the bean
+ * @param whenRequired the state when to uninstall
+ * @return the parameter builder
+ */
+ public abstract ParameterMetaDataBuilder addUninstallWithParameters(String methodName, String bean, ControllerState state, ControllerState whenRequired);
+
+ /**
+ * Add property install callback.
+ *
+ * @param property the property name
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addPropertyInstallCallback(String property)
+ {
+ return addPropertyInstallCallback(property, null, null);
+ }
+
+ /**
+ * Add property install callback.
+ *
+ * @param property the property name
+ * @param whenRequired the when required state
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addPropertyInstallCallback(String property, ControllerState whenRequired)
+ {
+ return addPropertyInstallCallback(property, whenRequired, null);
+ }
+
+ /**
+ * Add property install callback.
+ *
+ * @param property the property name
+ * @param cardinality the cardinality
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addPropertyInstallCallback(String property, Cardinality cardinality)
+ {
+ return addPropertyInstallCallback(property, null, cardinality);
+ }
+
+ /**
+ * Add property install callback.
+ *
+ * @param property the property name
+ * @param whenRequired the when required state
+ * @param cardinality the cardinality
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addPropertyInstallCallback(String property, ControllerState whenRequired, Cardinality cardinality)
+ {
+ return addPropertyInstallCallback(property, null, whenRequired, null, cardinality);
+ }
+
+ /**
+ * Add property install callback.
+ *
+ * @param property the property name
+ * @param signature the property signature
+ * @param whenRequired the when required state
+ * @param dependentState the dependant state
+ * @param cardinality the cardinality
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addPropertyInstallCallback(
+ String property,
+ String signature,
+ ControllerState whenRequired,
+ ControllerState dependentState,
+ Cardinality cardinality);
+
+ /**
+ * Add property uninstall callback.
+ *
+ * @param property the property name
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addPropertyUninstallCallback(String property)
+ {
+ return addPropertyUninstallCallback(property, null, null);
+ }
+
+ /**
+ * Add property uninstall callback.
+ *
+ * @param property the property name
+ * @param whenRequired the when required state
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addPropertyUninstallCallback(String property, ControllerState whenRequired)
+ {
+ return addPropertyUninstallCallback(property, whenRequired, null);
+ }
+
+ /**
+ * Add property uninstall callback.
+ *
+ * @param property the property name
+ * @param cardinality the cardinality
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addPropertyUninstallCallback(String property, Cardinality cardinality)
+ {
+ return addPropertyUninstallCallback(property, null, cardinality);
+ }
+
+ /**
+ * Add property uninstall callback.
+ *
+ * @param property the property name
+ * @param whenRequired the when required state
+ * @param cardinality the cardinality
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addPropertyUninstallCallback(String property, ControllerState whenRequired, Cardinality cardinality)
+ {
+ return addPropertyUninstallCallback(property, null, whenRequired, null, cardinality);
+ }
+
+ /**
+ * Add property uninstall callback.
+ *
+ * @param property the property name
+ * @param signature the property signature
+ * @param whenRequired the when required state
+ * @param dependentState the dependant state
+ * @param cardinality the cardinality
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addPropertyUninstallCallback(
+ String property,
+ String signature,
+ ControllerState whenRequired,
+ ControllerState dependentState,
+ Cardinality cardinality);
+
+ /**
+ * Add method install callback.
+ *
+ * @param method the method name
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addMethodInstallCallback(String method)
+ {
+ return addMethodInstallCallback(method, null, null);
+ }
+
+ /**
+ * Add method install callback.
+ *
+ * @param method the method name
+ * @param whenRequired the when required state
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addMethodInstallCallback(String method, ControllerState whenRequired)
+ {
+ return addMethodInstallCallback(method, whenRequired, null);
+ }
+
+ /**
+ * Add method install callback.
+ *
+ * @param method the method name
+ * @param cardinality the cardinality
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addMethodInstallCallback(String method, Cardinality cardinality)
+ {
+ return addMethodInstallCallback(method, null, cardinality);
+ }
+
+ /**
+ * Add method install callback.
+ *
+ * @param method the method name
+ * @param whenRequired the when required state
+ * @param cardinality the cardinality
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addMethodInstallCallback(String method, ControllerState whenRequired, Cardinality cardinality)
+ {
+ return addMethodInstallCallback(method, null, whenRequired, null, cardinality);
+ }
+
+ /**
+ * Add method install callback.
+ *
+ * @param method the method name
+ * @param signature the method signature
+ * @param whenRequired the when required state
+ * @param dependentState the dependant state
+ * @param cardinality the cardinality
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addMethodInstallCallback(
+ String method,
+ String signature,
+ ControllerState whenRequired,
+ ControllerState dependentState,
+ Cardinality cardinality);
+
+ /**
+ * Add method uninstall callback.
+ *
+ * @param method the method name
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addMethodUninstallCallback(String method)
+ {
+ return addMethodUninstallCallback(method, null, null);
+ }
+
+ /**
+ * Add method uninstall callback.
+ *
+ * @param method the method name
+ * @param whenRequired the when required state
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addMethodUninstallCallback(String method, ControllerState whenRequired)
+ {
+ return addMethodUninstallCallback(method, whenRequired, null);
+ }
+
+ /**
+ * Add method uninstall callback.
+ *
+ * @param method the method name
+ * @param cardinality the cardinality
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addMethodUninstallCallback(String method, Cardinality cardinality)
+ {
+ return addMethodUninstallCallback(method, null, cardinality);
+ }
+
+ /**
+ * Add method uninstall callback.
+ *
+ * @param method the method name
+ * @param whenRequired the when required state
+ * @param cardinality the cardinality
+ * @return the builder
+ */
+ public BeanMetaDataBuilder addMethodUninstallCallback(String method, ControllerState whenRequired, Cardinality cardinality)
+ {
+ return addMethodUninstallCallback(method, null, whenRequired, null, cardinality);
+ }
+
+ /**
+ * Add method uninstall callback.
+ *
+ * @param method the method name
+ * @param signature the method signature
+ * @param whenRequired the when required state
+ * @param dependentState the dependant state
+ * @param cardinality the cardinality
+ * @return the builder
+ */
+ public abstract BeanMetaDataBuilder addMethodUninstallCallback(
+ String method,
+ String signature,
+ ControllerState whenRequired,
+ ControllerState dependentState,
+ Cardinality cardinality);
+
+ /**
+ * Create related class name.
+ *
+ * @param className the related class name
+ * @param enabled the enabled
+ * @return new related class meta data
+ */
+ public abstract RelatedClassMetaData createRelated(String className, Object... enabled);
+
+ /**
+ * Create a null value
+ *
+ * @return the null value
+ */
+ public abstract ValueMetaData createNull();
+
+ /**
+ * Create a this value
+ *
+ * @return the this value
+ */
+ public abstract ValueMetaData createThis();
+
+ /**
+ * Create a value
+ *
+ * @param value the already constructed value
+ * @return the value
+ */
+ public abstract ValueMetaData createValue(Object value);
+
+ /**
+ * Create a string value
+ *
+ * @param type the type to be converted into
+ * @param value the value
+ * @return the string value
+ */
+ public abstract ValueMetaData createString(String type, String value);
+
+ /**
+ * Create an injection
+ *
+ * @param bean the bean to inject
+ * @return the injection
+ */
+ public ValueMetaData createInject(Object bean)
+ {
+ return createInject(bean, null, null, null);
+ }
+
+ /**
+ * Create an injection
+ *
+ * @param bean the bean to inject
+ * @param property the property of the bean
+ * @return the injection
+ */
+ public ValueMetaData createInject(Object bean, String property)
+ {
+ return createInject(bean, property, null, null);
+ }
+
+ /**
+ * Create an injection
+ *
+ * @param bean the bean to inject
+ * @param property the property of the bean
+ * @param whenRequired when the injection is required
+ * @param dependentState the state of the injected bean
+ * @return the injection
+ */
+ public abstract ValueMetaData createInject(Object bean, String property, ControllerState whenRequired, ControllerState dependentState);
+
+ /**
+ * Create contextual injection.
+ *
+ * @return the contextual injection
+ */
+ public ValueMetaData createContextualInject()
+ {
+ return createContextualInject(null, null);
+ }
+
+ /**
+ * Create contextual injection.
+ *
+ * @param whenRequired when the injection is required
+ * @param dependentState the state of the injected bean
+ * @return the contextual injection
+ */
+ public ValueMetaData createContextualInject(ControllerState whenRequired, ControllerState dependentState)
+ {
+ return createContextualInject(whenRequired, dependentState, null, null);
+ }
+
+ /**
+ * Create contextual injection.
+ *
+ * @param whenRequired when the injection is required
+ * @param dependentState the state of the injected bean
+ * @param autowire the autowire type
+ * @param option the inject option
+ * @return the contextual injection
+ */
+ public abstract ValueMetaData createContextualInject(ControllerState whenRequired, ControllerState dependentState, AutowireType autowire, InjectOption option);
+
+ /**
+ * Create a new collection
+ *
+ * @return the collection
+ */
+ public Collection<ValueMetaData> createCollection()
+ {
+ return createCollection(null, null);
+ }
+
+ /**
+ * Create a new collection
+ *
+ * @param collectionType the collection type
+ * @param elementType the element type
+ * @return the collection
+ */
+ public abstract Collection<ValueMetaData> createCollection(String collectionType, String elementType);
+
+ /**
+ * Create a new list
+ *
+ * @return the list
+ */
+ public List<ValueMetaData> createList()
+ {
+ return createList(null, null);
+ }
+
+ /**
+ * Create a new list
+ *
+ * @param listType the list type
+ * @param elementType the element type
+ * @return the list
+ */
+ public abstract List<ValueMetaData> createList(String listType, String elementType);
+
+ /**
+ * Create a new set
+ *
+ * @return the set
+ */
+ public Set<ValueMetaData> createSet()
+ {
+ return createSet(null, null);
+ }
+
+ /**
+ * Create a new set
+ *
+ * @param setType the set type
+ * @param elementType the element type
+ * @return the set
+ */
+ public abstract Set<ValueMetaData> createSet(String setType, String elementType);
+
+ /**
+ * Create a new array
+ *
+ * @return the array
+ */
+ public List<ValueMetaData> createArray()
+ {
+ return createArray(null, null);
+ }
+
+ /**
+ * Create a new array
+ *
+ * @param arrayType the array type
+ * @param elementType the element type
+ * @return the set
+ */
+ public abstract List<ValueMetaData> createArray(String arrayType, String elementType);
+
+ /**
+ * Create a new map
+ *
+ * @return the map
+ */
+ public Map<ValueMetaData, ValueMetaData> createMap()
+ {
+ return createMap(null, null, null);
+ }
+
+ /**
+ * Create a new map
+ *
+ * @param mapType the map type
+ * @param keyType the key type
+ * @param valueType the value type
+ * @return the map
+ */
+ public abstract Map<ValueMetaData, ValueMetaData> createMap(String mapType, String keyType, String valueType);
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,451 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.kernel.plugins.dependency;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.SupplyMetaData;
-import org.jboss.dependency.plugins.ScopedController;
-import org.jboss.dependency.plugins.action.ControllerContextAction;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.api.dependency.Matcher;
-import org.jboss.kernel.plugins.event.AbstractEventEmitter;
-import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.kernel.spi.event.KernelEvent;
-import org.jboss.kernel.spi.event.KernelEventFilter;
-import org.jboss.kernel.spi.event.KernelEventListener;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.kernel.spi.registry.KernelRegistryPlugin;
-
-/**
- * Abstract Kernel controller.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- * @version $Revision$
- */
- at SuppressWarnings("deprecation")
-public class AbstractKernelController extends ScopedController implements KernelController, KernelRegistryPlugin
-{
- /** The kernel */
- protected Kernel kernel;
-
- /** The emitter delegate */
- protected AbstractEventEmitter emitterDelegate = createEventEmitter();
-
- /** The supplies */
- protected Map<Object, List<KernelControllerContext>> suppliers = new ConcurrentHashMap<Object, List<KernelControllerContext>>();
-
- /** The contexts by class Map<Class, Set<ControllerContext>> */
- protected Map<Class<?>, ClassContext> contextsByClass = new ConcurrentHashMap<Class<?>, ClassContext>();
-
- /**
- * Create an abstract kernel controller
- *
- * @throws Exception for any error
- */
- public AbstractKernelController() throws Exception
- {
- }
-
- protected Map<ControllerState, ControllerContextAction> createAliasActions()
- {
- Map<ControllerState, ControllerContextAction> map = new HashMap<ControllerState, ControllerContextAction>(super.createAliasActions());
- map.put(ControllerState.PRE_INSTALL, InstallScopeAction.INSTANCE);
- return map;
- }
-
- /**
- * Create event emitter.
- *
- * @return new abstract event emitter instance
- */
- protected AbstractEventEmitter createEventEmitter()
- {
- return new AbstractEventEmitter();
- }
-
- public KernelControllerContext install(BeanMetaData metaData) throws Throwable
- {
- return install(metaData, null);
- }
-
- public KernelControllerContext install(BeanMetaData metaData, Object target) throws Throwable
- {
- KernelControllerContext context = new AbstractKernelControllerContext(null, metaData, target);
- install(context);
- return context;
- }
-
- public KernelRegistryEntry getEntry(Object name)
- {
- List<KernelControllerContext> list;
- if (name instanceof Matcher)
- list = matchSupplies((Matcher)name);
- else
- list = suppliers.get(name);
-
- if (list != null && list.isEmpty() == false)
- return list.get(0);
- else if (name instanceof Class)
- return getContextByClass((Class<?>) name);
- else
- return null;
- }
-
- /**
- * Try matching supplies.
- *
- * @param matcher the matcher
- * @return list of context's who have a matching supply
- */
- protected List<KernelControllerContext> matchSupplies(Matcher matcher)
- {
- List<KernelControllerContext> list = null;
- for(Map.Entry<Object, List<KernelControllerContext>> entry : suppliers.entrySet())
- {
- if (matcher.match(entry.getKey()))
- {
- if (matcher.needExactMatch() == false)
- return entry.getValue();
- else
- {
- if (list != null)
- throw new IllegalArgumentException("Matcher " + matcher + " only takes exact match, but found second matching supplier.");
- else
- list = entry.getValue();
- }
- }
- }
- return list;
- }
-
- public ControllerContext getContext(Object name, ControllerState state)
- {
- ControllerContext context = super.getContext(name, state);
- if (context != null)
- return context;
- if (state == null || ControllerState.INSTALLED.equals(state))
- {
- org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry();
- try
- {
- return registry.findEntry(name);
- }
- catch (Throwable ignored)
- {
- }
- }
- return null;
- }
-
- public void addSupplies(KernelControllerContext context)
- {
- BeanMetaData metaData = context.getBeanMetaData();
- Set<SupplyMetaData> supplies = metaData.getSupplies();
- if (supplies != null)
- {
- boolean trace = log.isTraceEnabled();
-
- if (supplies.isEmpty() == false)
- {
- lockWrite();
- try
- {
- for (SupplyMetaData supplied : supplies)
- {
- Object supply = supplied.getSupply();
- List<KernelControllerContext> list = suppliers.get(supply);
- if (list == null)
- {
- list = new CopyOnWriteArrayList<KernelControllerContext>();
- suppliers.put(supply, list);
- }
- list.add(context);
- if (trace)
- log.trace("Suppliers of " + supply + ": " + list);
- }
- }
- finally
- {
- unlockWrite();
- }
- }
- }
- }
-
- public void removeSupplies(KernelControllerContext context)
- {
- BeanMetaData metaData = context.getBeanMetaData();
- Set<SupplyMetaData> supplies = metaData.getSupplies();
- if (supplies != null)
- {
- boolean trace = log.isTraceEnabled();
-
- if (supplies.isEmpty() == false)
- {
- lockWrite();
- try
- {
- for (SupplyMetaData supplied : supplies)
- {
- Object supply = supplied.getSupply();
- List<KernelControllerContext> list = suppliers.get(supply);
- if (list != null)
- {
- list.remove(context);
- if (list.isEmpty())
- suppliers.remove(supply);
- if (trace)
- log.trace("Suppliers of " + supply + ": " + list);
- }
- }
- }
- finally
- {
- unlockWrite();
- }
- }
- }
- }
-
- public Kernel getKernel()
- {
- Kernel.checkAccess();
- return kernel;
- }
-
- public void setKernel(Kernel kernel) throws Throwable
- {
- Kernel.checkConfigure();
- this.kernel = kernel;
- }
-
- public void fireKernelEvent(KernelEvent event)
- {
- emitterDelegate.fireKernelEvent(event);
- }
-
- public void registerListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable
- {
- emitterDelegate.registerListener(listener, filter, handback);
- }
-
- public void unregisterListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable
- {
- emitterDelegate.unregisterListener(listener, filter, handback);
- }
-
- /**
- * Get contexts by class.
- * This method should be taken with read lock.
- *
- * @param clazz the class type
- * @return contexts by class
- */
- protected Set<KernelControllerContext> getContexts(Class<?> clazz)
- {
- ClassContext classContext = contextsByClass.get(clazz);
- if (classContext != null)
- {
- if (log.isTraceEnabled())
- {
- log.trace("Marking class " + clazz + " as used.");
- }
- classContext.used = true;
- return classContext.contexts;
- }
- return null;
- }
-
- /**
- * @return all instantiated contexts whose target is instance of this class clazz param
- */
- public Set<KernelControllerContext> getInstantiatedContexts(Class<?> clazz)
- {
- lockRead();
- try
- {
- Set<KernelControllerContext> contexts = getContexts(clazz);
- return contexts != null && contexts.isEmpty() == false ? Collections.unmodifiableSet(contexts) : null;
- }
- finally
- {
- unlockRead();
- }
- }
-
- public Set<KernelControllerContext> getContexts(Class<?> clazz, ControllerState state)
- {
- lockRead();
- try
- {
- Set<KernelControllerContext> contexts = getContexts(clazz);
- if (contexts != null && contexts.isEmpty() == false)
- {
- Set<KernelControllerContext> kccs = new HashSet<KernelControllerContext>();
- for(KernelControllerContext context : contexts)
- {
- if (isBeforeState(context.getState(), state) == false)
- kccs.add(context);
- }
- return Collections.unmodifiableSet(kccs);
- }
- else
- return null;
- }
- finally
- {
- unlockRead();
- }
- }
-
- public void addInstantiatedContext(KernelControllerContext context)
- {
- prepareToTraverse(context, true);
- }
-
- public void removeInstantiatedContext(KernelControllerContext context)
- {
- prepareToTraverse(context, false);
- }
-
- protected void prepareToTraverse(KernelControllerContext context, boolean addition)
- {
- lockWrite();
- try
- {
- Object target = context.getTarget();
- if (target != null)
- {
- traverseBean(context, target.getClass(), addition, log.isTraceEnabled());
- }
- }
- finally
- {
- unlockWrite();
- }
- }
-
- /**
- * Traverse over target and map it to all its superclasses
- * and interfaces - using recursion.
- *
- * @param context context whose target is instance of clazz
- * @param clazz current class to map context to
- * @param addition whether this is an addition
- * @param trace whether trace is enabled
- */
- protected void traverseBean(KernelControllerContext context, Class<?> clazz, boolean addition, boolean trace)
- {
- if (clazz == null || clazz == Object.class)
- {
- return;
- }
- ClassContext classContext = contextsByClass.get(clazz);
- if (addition)
- {
- if (classContext == null)
- {
- classContext = new ClassContext();
- classContext.contexts = new HashSet<KernelControllerContext>();
- contextsByClass.put(clazz, classContext);
- }
- else if (classContext.used)
- {
- log.debug("Additional matching bean - contextual injection already used for class: " + clazz);
- }
- if (trace)
- {
- log.trace("Mapping contex " + context + " to class: " + clazz);
- }
- classContext.contexts.add(context);
- }
- else
- {
- if (classContext != null)
- {
- if (trace)
- {
- log.trace("Removing contex " + context + " to class: " + clazz);
- }
- classContext.contexts.remove(context);
- }
- }
- // traverse superclass
- traverseBean(context, clazz.getSuperclass(), addition, trace);
- Class<?>[] interfaces = clazz.getInterfaces();
- // traverse interfaces
- for(Class<?> intface : interfaces)
- {
- traverseBean(context, intface, addition, trace);
- }
- }
-
- private class ClassContext
- {
- private boolean used;
- private Set<KernelControllerContext> contexts;
- }
-
- /**
- * If zero or multiple instances match class clazz
- * a warning is issued, but no throwable is thrown
- *
- * @return context whose target is instance of this class clazz param or null if zero or multiple such instances
- */
- public KernelControllerContext getContextByClass(Class<?> clazz)
- {
- Set<KernelControllerContext> contexts = getInstantiatedContexts(clazz);
- int numberOfMatchingBeans = 0;
- if (contexts != null)
- {
- numberOfMatchingBeans = contexts.size();
- }
-
- if (log.isTraceEnabled())
- {
- log.trace("Checking for contextual injection, current matches: " + numberOfMatchingBeans + " - " + clazz);
- }
-
- if (numberOfMatchingBeans != 1)
- {
- if (numberOfMatchingBeans > 1)
- {
- log.warn("Multiple beans match class type: " + clazz);
- }
- return null;
- }
- return contexts.iterator().next();
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,455 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, 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.kernel.plugins.dependency;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.SupplyMetaData;
+import org.jboss.dependency.plugins.ScopedController;
+import org.jboss.dependency.plugins.action.ControllerContextAction;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.api.dependency.Matcher;
+import org.jboss.kernel.plugins.event.AbstractEventEmitter;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.kernel.spi.event.KernelEvent;
+import org.jboss.kernel.spi.event.KernelEventFilter;
+import org.jboss.kernel.spi.event.KernelEventListener;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.kernel.spi.registry.KernelRegistryPlugin;
+
+/**
+ * Abstract Kernel controller.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ * @version $Revision$
+ */
+ at SuppressWarnings("deprecation")
+public class AbstractKernelController extends ScopedController implements KernelController, KernelRegistryPlugin
+{
+ /** The kernel */
+ protected Kernel kernel;
+
+ /** The emitter delegate */
+ protected AbstractEventEmitter emitterDelegate = createEventEmitter();
+
+ /** The supplies */
+ protected Map<Object, List<KernelControllerContext>> suppliers = new ConcurrentHashMap<Object, List<KernelControllerContext>>();
+
+ /** The contexts by class Map<Class, Set<ControllerContext>> */
+ protected Map<Class<?>, ClassContext> contextsByClass = new ConcurrentHashMap<Class<?>, ClassContext>();
+
+ /**
+ * Create an abstract kernel controller
+ *
+ * @throws Exception for any error
+ */
+ public AbstractKernelController() throws Exception
+ {
+ }
+
+ protected Map<ControllerState, ControllerContextAction> createAliasActions()
+ {
+ Map<ControllerState, ControllerContextAction> map = new HashMap<ControllerState, ControllerContextAction>(super.createAliasActions());
+ map.put(ControllerState.PRE_INSTALL, InstallScopeAction.INSTANCE);
+ return map;
+ }
+
+ /**
+ * Create event emitter.
+ *
+ * @return new abstract event emitter instance
+ */
+ protected AbstractEventEmitter createEventEmitter()
+ {
+ return new AbstractEventEmitter();
+ }
+
+ public KernelControllerContext install(BeanMetaData metaData) throws Throwable
+ {
+ return install(metaData, null);
+ }
+
+ public KernelControllerContext install(BeanMetaData metaData, Object target) throws Throwable
+ {
+ KernelControllerContext context = new AbstractKernelControllerContext(null, metaData, target);
+ install(context);
+ return context;
+ }
+
+ public KernelRegistryEntry getEntry(Object name)
+ {
+ List<KernelControllerContext> list;
+ if (name instanceof Matcher)
+ list = matchSupplies((Matcher)name);
+ else
+ list = suppliers.get(name);
+
+ if (list != null && list.isEmpty() == false)
+ return list.get(0);
+ else if (name instanceof Class)
+ return getContextByClass((Class<?>) name);
+ else
+ return null;
+ }
+
+ /**
+ * Try matching supplies.
+ *
+ * @param matcher the matcher
+ * @return list of context's who have a matching supply
+ */
+ protected List<KernelControllerContext> matchSupplies(Matcher matcher)
+ {
+ List<KernelControllerContext> list = null;
+ for(Map.Entry<Object, List<KernelControllerContext>> entry : suppliers.entrySet())
+ {
+ if (matcher.match(entry.getKey()))
+ {
+ if (matcher.needExactMatch() == false)
+ return entry.getValue();
+ else
+ {
+ if (list != null)
+ throw new IllegalArgumentException("Matcher " + matcher + " only takes exact match, but found second matching supplier.");
+ else
+ list = entry.getValue();
+ }
+ }
+ }
+ return list;
+ }
+
+ public ControllerContext getContext(Object name, ControllerState state)
+ {
+ ControllerContext context = super.getContext(name, state);
+ if (context != null)
+ return context;
+ if (state == null || ControllerState.INSTALLED.equals(state))
+ {
+ org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry();
+ try
+ {
+ return registry.findEntry(name);
+ }
+ catch (Throwable ignored)
+ {
+ }
+ }
+ return null;
+ }
+
+ public void addSupplies(KernelControllerContext context)
+ {
+ BeanMetaData metaData = context.getBeanMetaData();
+ Set<SupplyMetaData> supplies = metaData.getSupplies();
+ if (supplies != null)
+ {
+ boolean trace = log.isTraceEnabled();
+
+ if (supplies.isEmpty() == false)
+ {
+ lockWrite();
+ try
+ {
+ for (SupplyMetaData supplied : supplies)
+ {
+ Object supply = supplied.getSupply();
+ List<KernelControllerContext> list = suppliers.get(supply);
+ if (list == null)
+ {
+ list = new CopyOnWriteArrayList<KernelControllerContext>();
+ suppliers.put(supply, list);
+ }
+ list.add(context);
+ if (trace)
+ log.trace("Suppliers of " + supply + ": " + list);
+ }
+ }
+ finally
+ {
+ unlockWrite();
+ }
+ }
+ }
+ }
+
+ public void removeSupplies(KernelControllerContext context)
+ {
+ BeanMetaData metaData = context.getBeanMetaData();
+ Set<SupplyMetaData> supplies = metaData.getSupplies();
+ if (supplies != null)
+ {
+ boolean trace = log.isTraceEnabled();
+
+ if (supplies.isEmpty() == false)
+ {
+ lockWrite();
+ try
+ {
+ for (SupplyMetaData supplied : supplies)
+ {
+ Object supply = supplied.getSupply();
+ List<KernelControllerContext> list = suppliers.get(supply);
+ if (list != null)
+ {
+ list.remove(context);
+ if (list.isEmpty())
+ suppliers.remove(supply);
+ if (trace)
+ log.trace("Suppliers of " + supply + ": " + list);
+ }
+ }
+ }
+ finally
+ {
+ unlockWrite();
+ }
+ }
+ }
+ }
+
+ public Kernel getKernel()
+ {
+ Kernel.checkAccess();
+ return kernel;
+ }
+
+ public void setKernel(Kernel kernel) throws Throwable
+ {
+ Kernel.checkConfigure();
+ this.kernel = kernel;
+ }
+
+ public void fireKernelEvent(KernelEvent event)
+ {
+ emitterDelegate.fireKernelEvent(event);
+ }
+
+ public void registerListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable
+ {
+ emitterDelegate.registerListener(listener, filter, handback);
+ }
+
+ public void unregisterListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable
+ {
+ emitterDelegate.unregisterListener(listener, filter, handback);
+ }
+
+ /**
+ * Get contexts by class.
+ * This method should be taken with read lock.
+ *
+ * @param clazz the class type
+ * @return contexts by class
+ */
+ protected Set<KernelControllerContext> getContexts(Class<?> clazz)
+ {
+ ClassContext classContext = contextsByClass.get(clazz);
+ if (classContext != null)
+ {
+ if (log.isTraceEnabled())
+ {
+ log.trace("Marking class " + clazz + " as used.");
+ }
+ classContext.used = true;
+ return classContext.contexts;
+ }
+ return null;
+ }
+
+ /**
+ * @return all instantiated contexts whose target is instance of this class clazz param
+ */
+ public Set<KernelControllerContext> getInstantiatedContexts(Class<?> clazz)
+ {
+ lockRead();
+ try
+ {
+ Set<KernelControllerContext> contexts = getContexts(clazz);
+ return contexts != null && contexts.isEmpty() == false ? Collections.unmodifiableSet(contexts) : null;
+ }
+ finally
+ {
+ unlockRead();
+ }
+ }
+
+ public Set<KernelControllerContext> getContexts(Class<?> clazz, ControllerState state)
+ {
+ lockRead();
+ try
+ {
+ Set<KernelControllerContext> contexts = getContexts(clazz);
+ if (contexts != null && contexts.isEmpty() == false)
+ {
+ Set<KernelControllerContext> kccs = new HashSet<KernelControllerContext>();
+ for(KernelControllerContext context : contexts)
+ {
+ if (isBeforeState(context.getState(), state) == false)
+ kccs.add(context);
+ }
+ return Collections.unmodifiableSet(kccs);
+ }
+ else
+ return null;
+ }
+ finally
+ {
+ unlockRead();
+ }
+ }
+
+ public void addInstantiatedContext(KernelControllerContext context)
+ {
+ prepareToTraverse(context, true);
+ }
+
+ public void removeInstantiatedContext(KernelControllerContext context)
+ {
+ prepareToTraverse(context, false);
+ }
+
+ protected void prepareToTraverse(KernelControllerContext context, boolean addition)
+ {
+ lockWrite();
+ try
+ {
+ Object target = context.getTarget();
+ if (target != null)
+ {
+ traverseBean(context, target.getClass(), addition, log.isTraceEnabled());
+ }
+ }
+ finally
+ {
+ unlockWrite();
+ }
+ }
+
+ /**
+ * Traverse over target and map it to all its superclasses
+ * and interfaces - using recursion.
+ *
+ * @param context context whose target is instance of clazz
+ * @param clazz current class to map context to
+ * @param addition whether this is an addition
+ * @param trace whether trace is enabled
+ */
+ protected void traverseBean(KernelControllerContext context, Class<?> clazz, boolean addition, boolean trace)
+ {
+ if (clazz == null || clazz == Object.class)
+ {
+ return;
+ }
+ ClassContext classContext = contextsByClass.get(clazz);
+ if (addition)
+ {
+ if (classContext == null)
+ {
+ classContext = new ClassContext();
+ classContext.contexts = new HashSet<KernelControllerContext>();
+ contextsByClass.put(clazz, classContext);
+ }
+ else if (classContext.used)
+ {
+ log.debug("Additional matching bean - contextual injection already used for class: " + clazz);
+ }
+ if (trace)
+ {
+ log.trace("Mapping contex " + context + " to class: " + clazz);
+ }
+ classContext.contexts.add(context);
+ }
+ else
+ {
+ if (classContext != null)
+ {
+ if (trace)
+ {
+ log.trace("Removing contex " + context + " to class: " + clazz);
+ }
+ classContext.contexts.remove(context);
+ }
+ }
+ // traverse superclass
+ traverseBean(context, clazz.getSuperclass(), addition, trace);
+ Class<?>[] interfaces = clazz.getInterfaces();
+ // traverse interfaces
+ for(Class<?> intface : interfaces)
+ {
+ traverseBean(context, intface, addition, trace);
+ }
+ }
+
+ private class ClassContext
+ {
+ private boolean used;
+ private Set<KernelControllerContext> contexts;
+ }
+
+ /**
+ * If zero or multiple instances match class clazz
+ * a warning is issued, but no throwable is thrown
+ *
+ * @return context whose target is instance of this class clazz param or null if zero or multiple such instances
+ */
+ public KernelControllerContext getContextByClass(Class<?> clazz)
+ {
+ Set<KernelControllerContext> contexts = getInstantiatedContexts(clazz);
+ int numberOfMatchingBeans = 0;
+ if (contexts != null)
+ {
+ numberOfMatchingBeans = contexts.size();
+ }
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("Checking for contextual injection, current matches: " + numberOfMatchingBeans + " - " + clazz);
+ }
+
+ if (numberOfMatchingBeans != 1)
+ {
+ if (numberOfMatchingBeans > 1)
+ {
+ log.warn("Multiple beans match class type [enable trace log for details]: " + clazz);
+ if (log.isTraceEnabled())
+ {
+ log.trace("Matching contexts: " + contexts);
+ }
+ }
+ return null;
+ }
+ return contexts.iterator().next();
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,914 +0,0 @@
-/*
-* 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.kernel.config.test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.Test;
-import org.jboss.beans.metadata.api.model.AutowireType;
-import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
-import org.jboss.beans.metadata.plugins.AbstractRelatedClassMetaData;
-import org.jboss.beans.metadata.plugins.InstallCallbackMetaData;
-import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData;
-import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
-import org.jboss.beans.metadata.spi.CallbackMetaData;
-import org.jboss.beans.metadata.spi.RelatedClassMetaData;
-import org.jboss.beans.metadata.spi.ValueMetaData;
-import org.jboss.beans.metadata.spi.LifecycleMetaData;
-import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
-import org.jboss.dependency.spi.Cardinality;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.dependency.spi.ErrorHandlingMode;
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.plugins.deployment.AbstractKernelDeployer;
-import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
-import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.metadata.spi.MetaData;
-import org.jboss.test.kernel.config.support.SimpleAnnotation;
-import org.jboss.test.kernel.config.support.SimpleBean;
-import org.jboss.test.kernel.config.support.SimpleCallbackBean;
-import org.jboss.test.kernel.config.support.SimpleLifecycleBean;
-import org.jboss.test.kernel.config.support.Transformer;
-import org.jboss.test.kernel.config.support.TrimTransformer;
-
-/**
- * Builder TestCase.
- *
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- */
-public class BeanMetaDataBuilderTestCase extends AbstractKernelConfigTest
-{
- public static Test suite()
- {
- return suite(BeanMetaDataBuilderTestCase.class);
- }
-
- public BeanMetaDataBuilderTestCase(String name) throws Throwable
- {
- super(name);
- }
-
- public void testConstructor() throws Throwable
- {
- BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("FromBMD", SimpleBean.class.getName());
- builder.addConstructorParameter(String.class.getName(), "TestConstructor");
- BeanMetaData beanMetaData = builder.getBeanMetaData();
- SimpleBean fbmd = (SimpleBean)instantiateAndConfigure(beanMetaData);
-
- assertNotNull(fbmd);
- assertNotNull(fbmd.getConstructorUsed());
- assertEquals("TestConstructor", fbmd.getConstructorUsed());
- }
-
- public void testProperty() throws Throwable
- {
- BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("PropBMD", SimpleBean.class.getName())
- .addPropertyMetaData("adouble", 3.1459)
- .addPropertyMetaData("anint", "123")
- .addPropertyMetaData("collection", new ArrayList<Object>());
- BeanMetaData beanMetaData = builder.getBeanMetaData();
- SimpleBean pbmd = (SimpleBean)instantiateAndConfigure(beanMetaData);
-
- assertNotNull(pbmd);
- assertEquals(3.1459, pbmd.getAdouble());
- assertEquals(123, pbmd.getAnint());
- assertNotNull(pbmd.getCollection());
- assertTrue(pbmd.getCollection().isEmpty());
- }
-
- public void testLifecycle() throws Throwable
- {
- Kernel kernel = bootstrap();
-
- BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SLB", SimpleLifecycleBean.class.getName())
- .addCreateParameter(String.class.getName(), "ParamCreate")
- .setStart("doStart")
- .addStartParameter(String.class.getName(), "ParamStart")
- .setStop("doStop")
- .addStopParameter(String.class.getName(), "ParamStop")
- .addDestroyParameter(String.class.getName(), "ParamDestroy");
- BeanMetaData beanMetaData = builder.getBeanMetaData();
-
- KernelController controller = kernel.getController();
-
- KernelControllerContext context = controller.install(beanMetaData);
- SimpleLifecycleBean slb = (SimpleLifecycleBean)context.getTarget();
-
- assertNotNull(slb);
- assertEquals("ParamCreate", slb.getCreate());
- assertEquals("ParamStart", slb.getStart());
-
- controller.uninstall("SLB");
-
- assertEquals("ParamStop", slb.getStop());
- assertEquals("ParamDestroy", slb.getDestroy());
- }
-
- public void testInstall() throws Throwable
- {
- Kernel kernel = bootstrap();
-
- BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SLB", SimpleLifecycleBean.class.getName())
- .addInstall("installParam", String.class.getName(), "Install")
- .addUninstall("uninstallParam", String.class.getName(), "Uninstall");
- BeanMetaData beanMetaData = builder.getBeanMetaData();
-
- KernelController controller = kernel.getController();
-
- KernelControllerContext context = controller.install(beanMetaData);
- SimpleLifecycleBean slb = (SimpleLifecycleBean)context.getTarget();
-
- assertNotNull(slb);
- assertEquals("Install", slb.getInstall());
-
- controller.uninstall("SLB");
-
- assertEquals("Uninstall", slb.getInstall());
- }
-
- @SuppressWarnings("deprecation")
- public void testDemandSupply() throws Throwable
- {
- BeanMetaDataBuilder demand = BeanMetaDataBuilderFactory.createBuilder("DemandBean", SimpleBean.class.getName());
- demand.addDemand("Barrier");
- BeanMetaDataFactory demandBean = demand.getBeanMetaDataFactory();
-
- BeanMetaDataBuilder supply = BeanMetaDataBuilderFactory.createBuilder("SupplyBean", SimpleLifecycleBean.class.getName());
- supply.addSupply("Barrier");
- BeanMetaDataFactory supplyBean = supply.getBeanMetaDataFactory();
-
- AbstractKernelDeployment deployment = new AbstractKernelDeployment();
- deployment.setBeanFactories(Arrays.asList(demandBean, supplyBean));
-
- Kernel kernel = bootstrap();
- KernelController controller = kernel.getController();
- AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel);
-
- deployer.deploy(deployment);
- try
- {
- Object db = controller.getInstalledContext("DemandBean").getTarget();
- assertNotNull(db);
- Object sb = controller.getInstalledContext("SupplyBean").getTarget();
- assertNotNull(sb);
- }
- finally
- {
- deployer.undeploy(deployment);
- }
- }
-
- @SuppressWarnings("deprecation")
- public void testDependency() throws Throwable
- {
- BeanMetaDataBuilder dependOn = BeanMetaDataBuilderFactory.createBuilder("DependOnBean", SimpleBean.class.getName());
- dependOn.addDependency("DependencyResolver");
- BeanMetaDataFactory dependOnBean = dependOn.getBeanMetaDataFactory();
-
- BeanMetaDataBuilder resolver = BeanMetaDataBuilderFactory.createBuilder("DependencyResolver", SimpleLifecycleBean.class.getName());
- BeanMetaDataFactory resolverBean = resolver.getBeanMetaDataFactory();
-
- AbstractKernelDeployment deployment = new AbstractKernelDeployment();
- deployment.setBeanFactories(Arrays.asList(dependOnBean, resolverBean));
-
- Kernel kernel = bootstrap();
- KernelController controller = kernel.getController();
- AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel);
-
- deployer.deploy(deployment);
- try
- {
- Object db = controller.getInstalledContext("DependOnBean").getTarget();
- assertNotNull(db);
- Object rb = controller.getInstalledContext("DependencyResolver").getTarget();
- assertNotNull(rb);
- }
- finally
- {
- deployer.undeploy(deployment);
- }
- }
-
- @SuppressWarnings("deprecation")
- public void testCollectionProperties() throws Throwable
- {
- BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("CollectionBean", SimpleBean.class.getName());
-
- List<ValueMetaData> array = builder.createArray();
- array.add(builder.createValue(new Integer(5)));
- array.add(builder.createValue(new Integer(10)));
- builder.addPropertyMetaData("array", array);
-
- List<ValueMetaData> list = builder.createList();
- list.add(builder.createValue("One"));
- list.add(builder.createValue("Two"));
- builder.addPropertyMetaData("list", list);
-
- Set<ValueMetaData> set = builder.createSet();
- set.add(builder.createValue("En"));
- set.add(builder.createValue("To"));
- builder.addPropertyMetaData("set", set);
-
- Collection<ValueMetaData> collection = builder.createCollection();
- collection.add(builder.createValue("Eins"));
- collection.add(builder.createValue("Zwei"));
- builder.addPropertyMetaData("collection", collection);
-
- Map<ValueMetaData, ValueMetaData> map = builder.createMap();
- map.put(builder.createValue("One"), builder.createValue("Uno"));
- map.put(builder.createValue("Two"), builder.createValue("Dos"));
- builder.addPropertyMetaData("map", map);
-
- AbstractKernelDeployment deployment = new AbstractKernelDeployment();
- deployment.setBeanFactories(Arrays.asList(builder.getBeanMetaDataFactory()));
-
- Kernel kernel = bootstrap();
- KernelController controller = kernel.getController();
- AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel);
-
- deployer.deploy(deployment);
- try
- {
- Object o = controller.getInstalledContext("CollectionBean").getTarget();
- assertNotNull(o);
- assertInstanceOf(o, SimpleBean.class);
- SimpleBean bean = (SimpleBean)o;
-
- Object[] arr = bean.getArray();
- assertEquals(2, arr.length);
- assertEquals(5, arr[0]);
- assertEquals(10, arr[1]);
-
- List<?> lst = bean.getList();
- assertEquals(2, lst.size());
- assertEquals("One", lst.get(0));
- assertEquals("Two", lst.get(1));
-
- Set<?> st = bean.getSet();
- assertEquals(2, lst.size());
- assertTrue(st.contains("En"));
- assertTrue(st.contains("To"));
-
- Collection<?> coll = bean.getCollection();
- assertEquals(2, lst.size());
- assertTrue(coll.contains("Eins"));
- assertTrue(coll.contains("Zwei"));
-
- Map<?, ?> mp = bean.getMap();
- assertEquals(2, mp.size());
- assertEquals("Uno", mp.get("One"));
- assertEquals("Dos", mp.get("Two"));
- }
- finally
- {
- deployer.undeploy(deployment);
- }
- }
-
- @SuppressWarnings("deprecation")
- public void testReplacePropertyMetaData() throws Throwable
- {
- BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("ReplaceBean", SimpleBean.class.getName());
-
- builder.addPropertyMetaData("anInt", new Integer(1));
- builder.addPropertyMetaData("anInt", new Integer(5));
-
- builder.addPropertyMetaData("AString", "One");
- builder.addPropertyMetaData("AString", "Two");
-
- ValueMetaData value = builder.createValue("Three");
- builder.addPropertyMetaData("anObject", value);
- value = builder.createValue("Four");
- builder.addPropertyMetaData("anObject", value);
-
- List<ValueMetaData> array = builder.createArray();
- builder.addPropertyMetaData("array", array);
-
- array = builder.createArray();
- array.add(builder.createValue(new Integer(5)));
- array.add(builder.createValue(new Integer(10)));
- builder.addPropertyMetaData("array", array);
-
- Map<ValueMetaData, ValueMetaData> map = builder.createMap();
- builder.addPropertyMetaData("map", map);
-
- map = builder.createMap();
- map.put(builder.createValue("One"), builder.createValue("Uno"));
- map.put(builder.createValue("Two"), builder.createValue("Dos"));
- builder.addPropertyMetaData("map", map);
-
- AbstractKernelDeployment deployment = new AbstractKernelDeployment();
- deployment.setBeanFactories(Arrays.asList(builder.getBeanMetaDataFactory()));
-
- Kernel kernel = bootstrap();
- KernelController controller = kernel.getController();
- AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel);
-
- deployer.deploy(deployment);
- try
- {
- Object o = controller.getInstalledContext("ReplaceBean").getTarget();
- assertNotNull(o);
- assertInstanceOf(o, SimpleBean.class);
- SimpleBean bean = (SimpleBean)o;
-
- Integer integer = bean.getAnInt();
- assertEquals(new Integer(5), integer);
-
- String string = bean.getAString();
- assertEquals("Two", string);
-
- Object obj = bean.getAnObject();
- assertEquals("Four", obj);
-
- Object[] arr = bean.getArray();
- assertEquals(2, arr.length);
- assertEquals(5, arr[0]);
- assertEquals(10, arr[1]);
-
- Map<?, ?> mp = bean.getMap();
- assertEquals(2, mp.size());
- assertEquals("Uno", mp.get("One"));
- assertEquals("Dos", mp.get("Two"));
- }
- finally
- {
- deployer.undeploy(deployment);
- }
- }
-
- public void testCallbacks() throws Throwable
- {
- BeanMetaDataBuilder builder;
- BeanMetaData beanMetaData;
- List<CallbackMetaData> callbacks;
- CallbackMetaData callback;
- KernelControllerContext cc;
- Object target;
- Transformer<?> transformer;
- SimpleCallbackBean bean;
-
- Kernel kernel = bootstrap();
- KernelController controller = kernel.getController();
- try
- {
- beanMetaData = BeanMetaDataBuilder.createBuilder("t", TrimTransformer.class.getName()).getBeanMetaData();
- cc = controller.install(beanMetaData);
- assertNotNull(cc);
- assertEquals(ControllerState.INSTALLED, cc.getState());
- target = cc.getTarget();
- assertNotNull(target);
- transformer = assertInstanceOf(target, Transformer.class);
-
- // ct1
-
- builder = BeanMetaDataBuilder.createBuilder("ct1", SimpleCallbackBean.class.getName());
- builder.addPropertyInstallCallback("transformers");
- builder.addPropertyUninstallCallback("transformers");
- beanMetaData = builder.getBeanMetaData();
-
- callbacks = beanMetaData.getInstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, InstallCallbackMetaData.class, false);
- assertEquals("transformers", callback.getProperty());
- assertEquals(ControllerState.INSTALLED, callback.getDependentState());
- assertNull(callback.getState());
- assertNull(callback.getSignature());
- assertNull(callback.getMethodName());
- assertNull(callback.getCardinality());
- assertNull(callback.getParameters());
-
- callbacks = beanMetaData.getUninstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
- assertEquals("transformers", callback.getProperty());
- assertEquals(ControllerState.INSTALLED, callback.getDependentState());
- assertNull(callback.getState());
- assertNull(callback.getSignature());
- assertNull(callback.getMethodName());
- assertNull(callback.getCardinality());
- assertNull(callback.getParameters());
-
- cc = controller.install(beanMetaData);
- assertNotNull(cc);
- assertEquals(ControllerState.INSTALLED, cc.getState());
- target = cc.getTarget();
- assertNotNull(target);
- bean = assertInstanceOf(target, SimpleCallbackBean.class);
- assertNotNull(bean.getTransformers());
- assertEquals(1, bean.getTransformers().size());
- assertSame(transformer, bean.getTransformers().iterator().next());
-
- // ct2
-
- builder = BeanMetaDataBuilder.createBuilder("ct2", SimpleCallbackBean.class.getName());
- builder.addPropertyInstallCallback("transformers", Cardinality.ONE_TO_MANY);
- builder.addPropertyUninstallCallback("transformers", Cardinality.ONE_TO_MANY);
- beanMetaData = builder.getBeanMetaData();
-
- callbacks = beanMetaData.getInstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, InstallCallbackMetaData.class, false);
- assertEquals("transformers", callback.getProperty());
- assertEquals(ControllerState.INSTALLED, callback.getDependentState());
- assertNull(callback.getState());
- assertNull(callback.getSignature());
- assertNull(callback.getMethodName());
- assertEquals(Cardinality.ONE_TO_MANY, callback.getCardinality());
- assertNull(callback.getParameters());
-
- callbacks = beanMetaData.getUninstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
- assertEquals("transformers", callback.getProperty());
- assertEquals(ControllerState.INSTALLED, callback.getDependentState());
- assertNull(callback.getState());
- assertNull(callback.getSignature());
- assertNull(callback.getMethodName());
- assertEquals(Cardinality.ONE_TO_MANY, callback.getCardinality());
- assertNull(callback.getParameters());
-
- cc = controller.install(beanMetaData);
- assertNotNull(cc);
- assertEquals(ControllerState.INSTALLED, cc.getState());
- target = cc.getTarget();
- assertNotNull(target);
- bean = assertInstanceOf(target, SimpleCallbackBean.class);
- assertNotNull(bean.getTransformers());
- assertEquals(1, bean.getTransformers().size());
- assertSame(transformer, bean.getTransformers().iterator().next());
-
- // ct3
-
- builder = BeanMetaDataBuilder.createBuilder("ct3", SimpleCallbackBean.class.getName());
- builder.addPropertyInstallCallback("transformers", ControllerState.CREATE);
- builder.addPropertyUninstallCallback("transformers", ControllerState.CREATE);
- beanMetaData = builder.getBeanMetaData();
-
- callbacks = beanMetaData.getInstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, InstallCallbackMetaData.class, false);
- assertEquals("transformers", callback.getProperty());
- assertEquals(ControllerState.INSTALLED, callback.getDependentState());
- assertEquals(ControllerState.CREATE, callback.getState());
- assertNull(callback.getSignature());
- assertNull(callback.getMethodName());
- assertNull(callback.getCardinality());
- assertNull(callback.getParameters());
-
- callbacks = beanMetaData.getUninstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
- assertEquals("transformers", callback.getProperty());
- assertEquals(ControllerState.INSTALLED, callback.getDependentState());
- assertEquals(ControllerState.CREATE, callback.getState());
- assertNull(callback.getSignature());
- assertNull(callback.getMethodName());
- assertNull(callback.getCardinality());
- assertNull(callback.getParameters());
-
- cc = controller.install(beanMetaData);
- assertNotNull(cc);
- assertEquals(ControllerState.INSTALLED, cc.getState());
- target = cc.getTarget();
- assertNotNull(target);
- bean = assertInstanceOf(target, SimpleCallbackBean.class);
- assertNotNull(bean.getTransformers());
- assertEquals(1, bean.getTransformers().size());
- assertSame(transformer, bean.getTransformers().iterator().next());
-
- // ct4
-
- builder = BeanMetaDataBuilder.createBuilder("ct4", SimpleCallbackBean.class.getName());
- builder.addPropertyInstallCallback("transformers", Set.class.getName(), ControllerState.CREATE, ControllerState.START, Cardinality.ZERO_TO_ONE);
- builder.addPropertyUninstallCallback("transformers", Set.class.getName(), ControllerState.CREATE, ControllerState.START, Cardinality.ZERO_TO_ONE);
- beanMetaData = builder.getBeanMetaData();
-
- callbacks = beanMetaData.getInstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, InstallCallbackMetaData.class, false);
- assertEquals("transformers", callback.getProperty());
- assertEquals(ControllerState.START, callback.getDependentState());
- assertEquals(ControllerState.CREATE, callback.getState());
- assertEquals(Set.class.getName(), callback.getSignature());
- assertEquals(Cardinality.ZERO_TO_ONE, callback.getCardinality());
- assertNull(callback.getMethodName());
- assertNull(callback.getParameters());
-
- callbacks = beanMetaData.getUninstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
- assertEquals("transformers", callback.getProperty());
- assertEquals(ControllerState.START, callback.getDependentState());
- assertEquals(ControllerState.CREATE, callback.getState());
- assertEquals(Set.class.getName(), callback.getSignature());
- assertEquals(Cardinality.ZERO_TO_ONE, callback.getCardinality());
- assertNull(callback.getMethodName());
- assertNull(callback.getParameters());
-
- cc = controller.install(beanMetaData);
- assertNotNull(cc);
- assertEquals(ControllerState.INSTALLED, cc.getState());
- target = cc.getTarget();
- assertNotNull(target);
- bean = assertInstanceOf(target, SimpleCallbackBean.class);
- assertNotNull(bean.getTransformers());
- assertEquals(1, bean.getTransformers().size());
- assertSame(transformer, bean.getTransformers().iterator().next());
-
- // ct1
-
- builder = BeanMetaDataBuilder.createBuilder("mct1", SimpleCallbackBean.class.getName());
- builder.addMethodInstallCallback("addTransformer");
- builder.addMethodUninstallCallback("removeTransformer");
- beanMetaData = builder.getBeanMetaData();
-
- callbacks = beanMetaData.getInstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, InstallCallbackMetaData.class, false);
- assertEquals("addTransformer", callback.getMethodName());
- assertEquals(ControllerState.INSTALLED, callback.getDependentState());
- assertNull(callback.getState());
- assertNull(callback.getSignature());
- assertNull(callback.getProperty());
- assertNull(callback.getCardinality());
- assertNull(callback.getParameters());
-
- callbacks = beanMetaData.getUninstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
- assertEquals("removeTransformer", callback.getMethodName());
- assertEquals(ControllerState.INSTALLED, callback.getDependentState());
- assertNull(callback.getState());
- assertNull(callback.getSignature());
- assertNull(callback.getProperty());
- assertNull(callback.getCardinality());
- assertNull(callback.getParameters());
-
- cc = controller.install(beanMetaData);
- assertNotNull(cc);
- assertEquals(ControllerState.INSTALLED, cc.getState());
- target = cc.getTarget();
- assertNotNull(target);
- bean = assertInstanceOf(target, SimpleCallbackBean.class);
- assertNotNull(bean.getTransformers());
- assertEquals(1, bean.getTransformers().size());
- assertSame(transformer, bean.getTransformers().iterator().next());
-
- // ct2
-
- builder = BeanMetaDataBuilder.createBuilder("mct2", SimpleCallbackBean.class.getName());
- builder.addMethodInstallCallback("addTransformer", Cardinality.ONE_TO_MANY);
- builder.addMethodUninstallCallback("removeTransformer", Cardinality.ONE_TO_MANY);
- beanMetaData = builder.getBeanMetaData();
-
- callbacks = beanMetaData.getInstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, InstallCallbackMetaData.class, false);
- assertEquals("addTransformer", callback.getMethodName());
- assertEquals(ControllerState.INSTALLED, callback.getDependentState());
- assertNull(callback.getState());
- assertNull(callback.getSignature());
- assertNull(callback.getProperty());
- assertEquals(Cardinality.ONE_TO_MANY, callback.getCardinality());
- assertNull(callback.getParameters());
-
- callbacks = beanMetaData.getUninstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
- assertEquals("removeTransformer", callback.getMethodName());
- assertEquals(ControllerState.INSTALLED, callback.getDependentState());
- assertNull(callback.getState());
- assertNull(callback.getSignature());
- assertNull(callback.getProperty());
- assertEquals(Cardinality.ONE_TO_MANY, callback.getCardinality());
- assertNull(callback.getParameters());
-
- cc = controller.install(beanMetaData);
- assertNotNull(cc);
- assertEquals(ControllerState.INSTALLED, cc.getState());
- target = cc.getTarget();
- assertNotNull(target);
- bean = assertInstanceOf(target, SimpleCallbackBean.class);
- assertNotNull(bean.getTransformers());
- assertEquals(1, bean.getTransformers().size());
- assertSame(transformer, bean.getTransformers().iterator().next());
-
- // ct3
-
- builder = BeanMetaDataBuilder.createBuilder("mct3", SimpleCallbackBean.class.getName());
- builder.addMethodInstallCallback("addTransformer", ControllerState.CREATE);
- builder.addMethodUninstallCallback("removeTransformer", ControllerState.CREATE);
- beanMetaData = builder.getBeanMetaData();
-
- callbacks = beanMetaData.getInstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, InstallCallbackMetaData.class, false);
- assertEquals("addTransformer", callback.getMethodName());
- assertEquals(ControllerState.INSTALLED, callback.getDependentState());
- assertEquals(ControllerState.CREATE, callback.getState());
- assertNull(callback.getSignature());
- assertNull(callback.getProperty());
- assertNull(callback.getCardinality());
- assertNull(callback.getParameters());
-
- callbacks = beanMetaData.getUninstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
- assertEquals("removeTransformer", callback.getMethodName());
- assertEquals(ControllerState.INSTALLED, callback.getDependentState());
- assertEquals(ControllerState.CREATE, callback.getState());
- assertNull(callback.getSignature());
- assertNull(callback.getProperty());
- assertNull(callback.getCardinality());
- assertNull(callback.getParameters());
-
- cc = controller.install(beanMetaData);
- assertNotNull(cc);
- assertEquals(ControllerState.INSTALLED, cc.getState());
- target = cc.getTarget();
- assertNotNull(target);
- bean = assertInstanceOf(target, SimpleCallbackBean.class);
- assertNotNull(bean.getTransformers());
- assertEquals(1, bean.getTransformers().size());
- assertSame(transformer, bean.getTransformers().iterator().next());
-
- // ct4
-
- builder = BeanMetaDataBuilder.createBuilder("mct4", SimpleCallbackBean.class.getName());
- builder.addMethodInstallCallback("addTransformer", Transformer.class.getName(), ControllerState.CREATE, ControllerState.START, Cardinality.ZERO_TO_ONE);
- builder.addMethodUninstallCallback("removeTransformer", Transformer.class.getName(), ControllerState.CREATE, ControllerState.START, Cardinality.ZERO_TO_ONE);
- beanMetaData = builder.getBeanMetaData();
-
- callbacks = beanMetaData.getInstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, InstallCallbackMetaData.class, false);
- assertEquals("addTransformer", callback.getMethodName());
- assertEquals(ControllerState.START, callback.getDependentState());
- assertEquals(ControllerState.CREATE, callback.getState());
- assertEquals(Transformer.class.getName(), callback.getSignature());
- assertEquals(Cardinality.ZERO_TO_ONE, callback.getCardinality());
- assertNull(callback.getProperty());
- assertNull(callback.getParameters());
-
- callbacks = beanMetaData.getUninstallCallbacks();
- assertNotNull(callbacks);
- assertEquals(1, callbacks.size());
- callback = callbacks.get(0);
- assertNotNull(callback);
- assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
- assertEquals("removeTransformer", callback.getMethodName());
- assertEquals(ControllerState.START, callback.getDependentState());
- assertEquals(ControllerState.CREATE, callback.getState());
- assertEquals(Transformer.class.getName(), callback.getSignature());
- assertEquals(Cardinality.ZERO_TO_ONE, callback.getCardinality());
- assertNull(callback.getProperty());
- assertNull(callback.getParameters());
-
- cc = controller.install(beanMetaData);
- assertNotNull(cc);
- assertEquals(ControllerState.INSTALLED, cc.getState());
- target = cc.getTarget();
- assertNotNull(target);
- bean = assertInstanceOf(target, SimpleCallbackBean.class);
- assertNotNull(bean.getTransformers());
- assertEquals(1, bean.getTransformers().size());
- assertSame(transformer, bean.getTransformers().iterator().next());
- }
- finally
- {
- controller.shutdown();
- }
- }
-
- public void testAliases() throws Throwable
- {
- Kernel kernel = bootstrap();
- KernelController controller = kernel.getController();
- try
- {
- BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("bean", SimpleBean.class.getName());
- builder.addAlias("alias");
- controller.install(builder.getBeanMetaData());
- assertNotNull(controller.getInstalledContext("alias"));
-
- builder = BeanMetaDataBuilderFactory.createBuilder("other", SimpleBean.class.getName());
- Object foobar = "foobar";
- builder.setAliases(Collections.singleton(foobar));
- controller.install(builder.getBeanMetaData());
- assertNotNull(controller.getInstalledContext("foobar"));
- }
- finally
- {
- controller.shutdown();
- }
- }
-
- public void testAnnotations() throws Throwable
- {
- Kernel kernel = bootstrap();
- KernelController controller = kernel.getController();
- try
- {
- BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("bean", SimpleBean.class.getName());
- builder.addAnnotation("@" + SimpleAnnotation.class.getName() + "(name=\"foobar\")");
- controller.install(builder.getBeanMetaData());
- ControllerContext cc = controller.getInstalledContext("bean");
- assertNotNull(cc);
- MetaData metaData = cc.getScopeInfo().getMetaData();
- assertNotNull(metaData);
- assertNotNull(metaData.getAnnotation(SimpleAnnotation.class));
-
- builder = BeanMetaDataBuilderFactory.createBuilder("other", SimpleBean.class.getName());
- builder.setAnnotations(Collections.singleton("@" + SimpleAnnotation.class.getName() + "(name=\"foobar\")"));
- controller.install(builder.getBeanMetaData());
- cc = controller.getInstalledContext("other");
- assertNotNull(cc);
- metaData = cc.getScopeInfo().getMetaData();
- assertNotNull(metaData);
- assertNotNull(metaData.getAnnotation(SimpleAnnotation.class));
- }
- finally
- {
- controller.shutdown();
- }
- }
-
- public void testNewEnums() throws Throwable
- {
- BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(Object.class.getName());
- builder.setErrorHandlingMode(ErrorHandlingMode.MANUAL);
- builder.setAutowireType(AutowireType.CONSTRUCTOR);
- builder.setAutowireCandidate(false);
-
- BeanMetaData bmd = builder.getBeanMetaData();
- assertEquals(ErrorHandlingMode.MANUAL, bmd.getErrorHandlingMode());
- assertEquals(AutowireType.CONSTRUCTOR, bmd.getAutowireType());
- assertFalse(bmd.isAutowireCandidate());
- }
-
- public void testBeanMetaDataFactory() throws Throwable
- {
- BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("bean", Object.class.getName());
- BeanMetaDataFactory f1 = builder.getBeanMetaDataFactory();
- assertNotNull(f1);
- BeanMetaDataFactory f2 = builder.asBeanMetaDataFactory();
- assertNotNull(f2);
- List<BeanMetaData> b1 = f1.getBeans();
- assertNotNull(b1);
- List<BeanMetaData> b2 = f1.getBeans();
- assertNotNull(b2);
- assertEquals(b1, b2);
-
- AbstractBeanMetaData abmd = new AbstractBeanMetaData("bean", Object.class.getName());
- builder = BeanMetaDataBuilder.createBuilder(abmd);
- assertSame(abmd, builder.getBeanMetaDataFactory());
- BeanMetaDataFactory bmdf = builder.asBeanMetaDataFactory();
- assertNotNull(bmdf);
- List<BeanMetaData> beans = bmdf.getBeans();
- assertNotNull(beans);
- assertFalse(beans.isEmpty());
- assertSame(abmd, beans.get(0));
- }
-
- public void testRelatedClassName() throws Throwable
- {
- RelatedClassMetaData rcmd = new AbstractRelatedClassMetaData(Object.class.getName());
- Set<RelatedClassMetaData> related = new HashSet<RelatedClassMetaData>();
- related.add(rcmd);
-
- BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Bean");
- builder.addRelatedClass(Object.class.getName());
- BeanMetaData bmd = builder.getBeanMetaData();
-
- assertEquals(related, bmd.getRelated());
- }
-
- public void testRelatedClassNameWithEnabled() throws Throwable
- {
- AbstractRelatedClassMetaData rcmd = new AbstractRelatedClassMetaData(Object.class.getName());
- rcmd.setEnabledValue("aop");
- Set<RelatedClassMetaData> related = new HashSet<RelatedClassMetaData>();
- related.add(rcmd);
-
- BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Bean");
- builder.addRelatedClass(Object.class.getName(), "aop");
- BeanMetaData bmd = builder.getBeanMetaData();
-
- assertEquals(related, bmd.getRelated());
- }
-
- public void testMultipleRelatedClassNameWithMultipleEnabled() throws Throwable
- {
- AbstractRelatedClassMetaData rcmd1 = new AbstractRelatedClassMetaData(Object.class.getName());
- rcmd1.setEnabled(new HashSet<Object>(Arrays.asList("aop", "md")));
- AbstractRelatedClassMetaData rcmd2 = new AbstractRelatedClassMetaData(String.class.getName());
- rcmd2.setEnabled(new HashSet<Object>(Arrays.asList("qwert", "foobar")));
-
- Set<RelatedClassMetaData> related = new HashSet<RelatedClassMetaData>();
- related.add(rcmd1);
- related.add(rcmd2);
-
- BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Bean");
- builder.addRelatedClass(Object.class.getName(), "aop", "md");
- builder.addRelatedClass(String.class.getName(), "qwert", "foobar");
- BeanMetaData bmd = builder.getBeanMetaData();
-
- assertEquals(related, bmd.getRelated());
- }
-
- public void testIgnoredLifecycle() throws Throwable
- {
- BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("test");
- builder.ignoreCreate();
- builder.ignoreStart();
- builder.ignoreStop();
- builder.ignoreDestroy();
- BeanMetaData bmd = builder.getBeanMetaData();
- assertIgnoredLifecycle(bmd.getCreate());
- assertIgnoredLifecycle(bmd.getStart());
- assertIgnoredLifecycle(bmd.getStop());
- assertIgnoredLifecycle(bmd.getDestroy());
- }
-
- protected void assertIgnoredLifecycle(LifecycleMetaData lmd)
- {
- assertNotNull(lmd);
- assertTrue(lmd.isIgnored());
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,929 @@
+/*
+* 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.kernel.config.test;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.api.model.AutowireType;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.plugins.AbstractRelatedClassMetaData;
+import org.jboss.beans.metadata.plugins.InstallCallbackMetaData;
+import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData;
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.beans.metadata.spi.CallbackMetaData;
+import org.jboss.beans.metadata.spi.RelatedClassMetaData;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.beans.metadata.spi.LifecycleMetaData;
+import org.jboss.beans.metadata.spi.PropertyMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.dependency.spi.Cardinality;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.ErrorHandlingMode;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.deployment.AbstractKernelDeployer;
+import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.test.kernel.config.support.SimpleAnnotation;
+import org.jboss.test.kernel.config.support.SimpleBean;
+import org.jboss.test.kernel.config.support.SimpleCallbackBean;
+import org.jboss.test.kernel.config.support.SimpleLifecycleBean;
+import org.jboss.test.kernel.config.support.Transformer;
+import org.jboss.test.kernel.config.support.TrimTransformer;
+
+/**
+ * Builder TestCase.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class BeanMetaDataBuilderTestCase extends AbstractKernelConfigTest
+{
+ public static Test suite()
+ {
+ return suite(BeanMetaDataBuilderTestCase.class);
+ }
+
+ public BeanMetaDataBuilderTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ public void testConstructor() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("FromBMD", SimpleBean.class.getName());
+ builder.addConstructorParameter(String.class.getName(), "TestConstructor");
+ BeanMetaData beanMetaData = builder.getBeanMetaData();
+ SimpleBean fbmd = (SimpleBean)instantiateAndConfigure(beanMetaData);
+
+ assertNotNull(fbmd);
+ assertNotNull(fbmd.getConstructorUsed());
+ assertEquals("TestConstructor", fbmd.getConstructorUsed());
+ }
+
+ public void testProperty() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("PropBMD", SimpleBean.class.getName())
+ .addPropertyMetaData("adouble", 3.1459)
+ .addPropertyMetaData("anint", "123")
+ .addPropertyMetaData("collection", new ArrayList<Object>());
+ BeanMetaData beanMetaData = builder.getBeanMetaData();
+ SimpleBean pbmd = (SimpleBean)instantiateAndConfigure(beanMetaData);
+
+ assertNotNull(pbmd);
+ assertEquals(3.1459, pbmd.getAdouble());
+ assertEquals(123, pbmd.getAnint());
+ assertNotNull(pbmd.getCollection());
+ assertTrue(pbmd.getCollection().isEmpty());
+ }
+
+ public void testLifecycle() throws Throwable
+ {
+ Kernel kernel = bootstrap();
+
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SLB", SimpleLifecycleBean.class.getName())
+ .addCreateParameter(String.class.getName(), "ParamCreate")
+ .setStart("doStart")
+ .addStartParameter(String.class.getName(), "ParamStart")
+ .setStop("doStop")
+ .addStopParameter(String.class.getName(), "ParamStop")
+ .addDestroyParameter(String.class.getName(), "ParamDestroy");
+ BeanMetaData beanMetaData = builder.getBeanMetaData();
+
+ KernelController controller = kernel.getController();
+
+ KernelControllerContext context = controller.install(beanMetaData);
+ SimpleLifecycleBean slb = (SimpleLifecycleBean)context.getTarget();
+
+ assertNotNull(slb);
+ assertEquals("ParamCreate", slb.getCreate());
+ assertEquals("ParamStart", slb.getStart());
+
+ controller.uninstall("SLB");
+
+ assertEquals("ParamStop", slb.getStop());
+ assertEquals("ParamDestroy", slb.getDestroy());
+ }
+
+ public void testInstall() throws Throwable
+ {
+ Kernel kernel = bootstrap();
+
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SLB", SimpleLifecycleBean.class.getName())
+ .addInstall("installParam", String.class.getName(), "Install")
+ .addUninstall("uninstallParam", String.class.getName(), "Uninstall");
+ BeanMetaData beanMetaData = builder.getBeanMetaData();
+
+ KernelController controller = kernel.getController();
+
+ KernelControllerContext context = controller.install(beanMetaData);
+ SimpleLifecycleBean slb = (SimpleLifecycleBean)context.getTarget();
+
+ assertNotNull(slb);
+ assertEquals("Install", slb.getInstall());
+
+ controller.uninstall("SLB");
+
+ assertEquals("Uninstall", slb.getInstall());
+ }
+
+ @SuppressWarnings("deprecation")
+ public void testDemandSupply() throws Throwable
+ {
+ BeanMetaDataBuilder demand = BeanMetaDataBuilderFactory.createBuilder("DemandBean", SimpleBean.class.getName());
+ demand.addDemand("Barrier");
+ BeanMetaDataFactory demandBean = demand.getBeanMetaDataFactory();
+
+ BeanMetaDataBuilder supply = BeanMetaDataBuilderFactory.createBuilder("SupplyBean", SimpleLifecycleBean.class.getName());
+ supply.addSupply("Barrier");
+ BeanMetaDataFactory supplyBean = supply.getBeanMetaDataFactory();
+
+ AbstractKernelDeployment deployment = new AbstractKernelDeployment();
+ deployment.setBeanFactories(Arrays.asList(demandBean, supplyBean));
+
+ Kernel kernel = bootstrap();
+ KernelController controller = kernel.getController();
+ AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel);
+
+ deployer.deploy(deployment);
+ try
+ {
+ Object db = controller.getInstalledContext("DemandBean").getTarget();
+ assertNotNull(db);
+ Object sb = controller.getInstalledContext("SupplyBean").getTarget();
+ assertNotNull(sb);
+ }
+ finally
+ {
+ deployer.undeploy(deployment);
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ public void testDependency() throws Throwable
+ {
+ BeanMetaDataBuilder dependOn = BeanMetaDataBuilderFactory.createBuilder("DependOnBean", SimpleBean.class.getName());
+ dependOn.addDependency("DependencyResolver");
+ BeanMetaDataFactory dependOnBean = dependOn.getBeanMetaDataFactory();
+
+ BeanMetaDataBuilder resolver = BeanMetaDataBuilderFactory.createBuilder("DependencyResolver", SimpleLifecycleBean.class.getName());
+ BeanMetaDataFactory resolverBean = resolver.getBeanMetaDataFactory();
+
+ AbstractKernelDeployment deployment = new AbstractKernelDeployment();
+ deployment.setBeanFactories(Arrays.asList(dependOnBean, resolverBean));
+
+ Kernel kernel = bootstrap();
+ KernelController controller = kernel.getController();
+ AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel);
+
+ deployer.deploy(deployment);
+ try
+ {
+ Object db = controller.getInstalledContext("DependOnBean").getTarget();
+ assertNotNull(db);
+ Object rb = controller.getInstalledContext("DependencyResolver").getTarget();
+ assertNotNull(rb);
+ }
+ finally
+ {
+ deployer.undeploy(deployment);
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ public void testCollectionProperties() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("CollectionBean", SimpleBean.class.getName());
+
+ List<ValueMetaData> array = builder.createArray();
+ array.add(builder.createValue(new Integer(5)));
+ array.add(builder.createValue(new Integer(10)));
+ builder.addPropertyMetaData("array", array);
+
+ List<ValueMetaData> list = builder.createList();
+ list.add(builder.createValue("One"));
+ list.add(builder.createValue("Two"));
+ builder.addPropertyMetaData("list", list);
+
+ Set<ValueMetaData> set = builder.createSet();
+ set.add(builder.createValue("En"));
+ set.add(builder.createValue("To"));
+ builder.addPropertyMetaData("set", set);
+
+ Collection<ValueMetaData> collection = builder.createCollection();
+ collection.add(builder.createValue("Eins"));
+ collection.add(builder.createValue("Zwei"));
+ builder.addPropertyMetaData("collection", collection);
+
+ Map<ValueMetaData, ValueMetaData> map = builder.createMap();
+ map.put(builder.createValue("One"), builder.createValue("Uno"));
+ map.put(builder.createValue("Two"), builder.createValue("Dos"));
+ builder.addPropertyMetaData("map", map);
+
+ AbstractKernelDeployment deployment = new AbstractKernelDeployment();
+ deployment.setBeanFactories(Arrays.asList(builder.getBeanMetaDataFactory()));
+
+ Kernel kernel = bootstrap();
+ KernelController controller = kernel.getController();
+ AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel);
+
+ deployer.deploy(deployment);
+ try
+ {
+ Object o = controller.getInstalledContext("CollectionBean").getTarget();
+ assertNotNull(o);
+ assertInstanceOf(o, SimpleBean.class);
+ SimpleBean bean = (SimpleBean)o;
+
+ Object[] arr = bean.getArray();
+ assertEquals(2, arr.length);
+ assertEquals(5, arr[0]);
+ assertEquals(10, arr[1]);
+
+ List<?> lst = bean.getList();
+ assertEquals(2, lst.size());
+ assertEquals("One", lst.get(0));
+ assertEquals("Two", lst.get(1));
+
+ Set<?> st = bean.getSet();
+ assertEquals(2, lst.size());
+ assertTrue(st.contains("En"));
+ assertTrue(st.contains("To"));
+
+ Collection<?> coll = bean.getCollection();
+ assertEquals(2, lst.size());
+ assertTrue(coll.contains("Eins"));
+ assertTrue(coll.contains("Zwei"));
+
+ Map<?, ?> mp = bean.getMap();
+ assertEquals(2, mp.size());
+ assertEquals("Uno", mp.get("One"));
+ assertEquals("Dos", mp.get("Two"));
+ }
+ finally
+ {
+ deployer.undeploy(deployment);
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ public void testReplacePropertyMetaData() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("ReplaceBean", SimpleBean.class.getName());
+
+ builder.addPropertyMetaData("anInt", new Integer(1));
+ builder.addPropertyMetaData("anInt", new Integer(5));
+
+ builder.addPropertyMetaData("AString", "One");
+ builder.addPropertyMetaData("AString", "Two");
+
+ ValueMetaData value = builder.createValue("Three");
+ builder.addPropertyMetaData("anObject", value);
+ value = builder.createValue("Four");
+ builder.addPropertyMetaData("anObject", value);
+
+ List<ValueMetaData> array = builder.createArray();
+ builder.addPropertyMetaData("array", array);
+
+ array = builder.createArray();
+ array.add(builder.createValue(new Integer(5)));
+ array.add(builder.createValue(new Integer(10)));
+ builder.addPropertyMetaData("array", array);
+
+ Map<ValueMetaData, ValueMetaData> map = builder.createMap();
+ builder.addPropertyMetaData("map", map);
+
+ map = builder.createMap();
+ map.put(builder.createValue("One"), builder.createValue("Uno"));
+ map.put(builder.createValue("Two"), builder.createValue("Dos"));
+ builder.addPropertyMetaData("map", map);
+
+ AbstractKernelDeployment deployment = new AbstractKernelDeployment();
+ deployment.setBeanFactories(Arrays.asList(builder.getBeanMetaDataFactory()));
+
+ Kernel kernel = bootstrap();
+ KernelController controller = kernel.getController();
+ AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel);
+
+ deployer.deploy(deployment);
+ try
+ {
+ Object o = controller.getInstalledContext("ReplaceBean").getTarget();
+ assertNotNull(o);
+ assertInstanceOf(o, SimpleBean.class);
+ SimpleBean bean = (SimpleBean)o;
+
+ Integer integer = bean.getAnInt();
+ assertEquals(new Integer(5), integer);
+
+ String string = bean.getAString();
+ assertEquals("Two", string);
+
+ Object obj = bean.getAnObject();
+ assertEquals("Four", obj);
+
+ Object[] arr = bean.getArray();
+ assertEquals(2, arr.length);
+ assertEquals(5, arr[0]);
+ assertEquals(10, arr[1]);
+
+ Map<?, ?> mp = bean.getMap();
+ assertEquals(2, mp.size());
+ assertEquals("Uno", mp.get("One"));
+ assertEquals("Dos", mp.get("Two"));
+ }
+ finally
+ {
+ deployer.undeploy(deployment);
+ }
+ }
+
+ public void testCallbacks() throws Throwable
+ {
+ BeanMetaDataBuilder builder;
+ BeanMetaData beanMetaData;
+ List<CallbackMetaData> callbacks;
+ CallbackMetaData callback;
+ KernelControllerContext cc;
+ Object target;
+ Transformer<?> transformer;
+ SimpleCallbackBean bean;
+
+ Kernel kernel = bootstrap();
+ KernelController controller = kernel.getController();
+ try
+ {
+ beanMetaData = BeanMetaDataBuilder.createBuilder("t", TrimTransformer.class.getName()).getBeanMetaData();
+ cc = controller.install(beanMetaData);
+ assertNotNull(cc);
+ assertEquals(ControllerState.INSTALLED, cc.getState());
+ target = cc.getTarget();
+ assertNotNull(target);
+ transformer = assertInstanceOf(target, Transformer.class);
+
+ // ct1
+
+ builder = BeanMetaDataBuilder.createBuilder("ct1", SimpleCallbackBean.class.getName());
+ builder.addPropertyInstallCallback("transformers");
+ builder.addPropertyUninstallCallback("transformers");
+ beanMetaData = builder.getBeanMetaData();
+
+ callbacks = beanMetaData.getInstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, InstallCallbackMetaData.class, false);
+ assertEquals("transformers", callback.getProperty());
+ assertEquals(ControllerState.INSTALLED, callback.getDependentState());
+ assertNull(callback.getState());
+ assertNull(callback.getSignature());
+ assertNull(callback.getMethodName());
+ assertNull(callback.getCardinality());
+ assertNull(callback.getParameters());
+
+ callbacks = beanMetaData.getUninstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
+ assertEquals("transformers", callback.getProperty());
+ assertEquals(ControllerState.INSTALLED, callback.getDependentState());
+ assertNull(callback.getState());
+ assertNull(callback.getSignature());
+ assertNull(callback.getMethodName());
+ assertNull(callback.getCardinality());
+ assertNull(callback.getParameters());
+
+ cc = controller.install(beanMetaData);
+ assertNotNull(cc);
+ assertEquals(ControllerState.INSTALLED, cc.getState());
+ target = cc.getTarget();
+ assertNotNull(target);
+ bean = assertInstanceOf(target, SimpleCallbackBean.class);
+ assertNotNull(bean.getTransformers());
+ assertEquals(1, bean.getTransformers().size());
+ assertSame(transformer, bean.getTransformers().iterator().next());
+
+ // ct2
+
+ builder = BeanMetaDataBuilder.createBuilder("ct2", SimpleCallbackBean.class.getName());
+ builder.addPropertyInstallCallback("transformers", Cardinality.ONE_TO_MANY);
+ builder.addPropertyUninstallCallback("transformers", Cardinality.ONE_TO_MANY);
+ beanMetaData = builder.getBeanMetaData();
+
+ callbacks = beanMetaData.getInstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, InstallCallbackMetaData.class, false);
+ assertEquals("transformers", callback.getProperty());
+ assertEquals(ControllerState.INSTALLED, callback.getDependentState());
+ assertNull(callback.getState());
+ assertNull(callback.getSignature());
+ assertNull(callback.getMethodName());
+ assertEquals(Cardinality.ONE_TO_MANY, callback.getCardinality());
+ assertNull(callback.getParameters());
+
+ callbacks = beanMetaData.getUninstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
+ assertEquals("transformers", callback.getProperty());
+ assertEquals(ControllerState.INSTALLED, callback.getDependentState());
+ assertNull(callback.getState());
+ assertNull(callback.getSignature());
+ assertNull(callback.getMethodName());
+ assertEquals(Cardinality.ONE_TO_MANY, callback.getCardinality());
+ assertNull(callback.getParameters());
+
+ cc = controller.install(beanMetaData);
+ assertNotNull(cc);
+ assertEquals(ControllerState.INSTALLED, cc.getState());
+ target = cc.getTarget();
+ assertNotNull(target);
+ bean = assertInstanceOf(target, SimpleCallbackBean.class);
+ assertNotNull(bean.getTransformers());
+ assertEquals(1, bean.getTransformers().size());
+ assertSame(transformer, bean.getTransformers().iterator().next());
+
+ // ct3
+
+ builder = BeanMetaDataBuilder.createBuilder("ct3", SimpleCallbackBean.class.getName());
+ builder.addPropertyInstallCallback("transformers", ControllerState.CREATE);
+ builder.addPropertyUninstallCallback("transformers", ControllerState.CREATE);
+ beanMetaData = builder.getBeanMetaData();
+
+ callbacks = beanMetaData.getInstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, InstallCallbackMetaData.class, false);
+ assertEquals("transformers", callback.getProperty());
+ assertEquals(ControllerState.INSTALLED, callback.getDependentState());
+ assertEquals(ControllerState.CREATE, callback.getState());
+ assertNull(callback.getSignature());
+ assertNull(callback.getMethodName());
+ assertNull(callback.getCardinality());
+ assertNull(callback.getParameters());
+
+ callbacks = beanMetaData.getUninstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
+ assertEquals("transformers", callback.getProperty());
+ assertEquals(ControllerState.INSTALLED, callback.getDependentState());
+ assertEquals(ControllerState.CREATE, callback.getState());
+ assertNull(callback.getSignature());
+ assertNull(callback.getMethodName());
+ assertNull(callback.getCardinality());
+ assertNull(callback.getParameters());
+
+ cc = controller.install(beanMetaData);
+ assertNotNull(cc);
+ assertEquals(ControllerState.INSTALLED, cc.getState());
+ target = cc.getTarget();
+ assertNotNull(target);
+ bean = assertInstanceOf(target, SimpleCallbackBean.class);
+ assertNotNull(bean.getTransformers());
+ assertEquals(1, bean.getTransformers().size());
+ assertSame(transformer, bean.getTransformers().iterator().next());
+
+ // ct4
+
+ builder = BeanMetaDataBuilder.createBuilder("ct4", SimpleCallbackBean.class.getName());
+ builder.addPropertyInstallCallback("transformers", Set.class.getName(), ControllerState.CREATE, ControllerState.START, Cardinality.ZERO_TO_ONE);
+ builder.addPropertyUninstallCallback("transformers", Set.class.getName(), ControllerState.CREATE, ControllerState.START, Cardinality.ZERO_TO_ONE);
+ beanMetaData = builder.getBeanMetaData();
+
+ callbacks = beanMetaData.getInstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, InstallCallbackMetaData.class, false);
+ assertEquals("transformers", callback.getProperty());
+ assertEquals(ControllerState.START, callback.getDependentState());
+ assertEquals(ControllerState.CREATE, callback.getState());
+ assertEquals(Set.class.getName(), callback.getSignature());
+ assertEquals(Cardinality.ZERO_TO_ONE, callback.getCardinality());
+ assertNull(callback.getMethodName());
+ assertNull(callback.getParameters());
+
+ callbacks = beanMetaData.getUninstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
+ assertEquals("transformers", callback.getProperty());
+ assertEquals(ControllerState.START, callback.getDependentState());
+ assertEquals(ControllerState.CREATE, callback.getState());
+ assertEquals(Set.class.getName(), callback.getSignature());
+ assertEquals(Cardinality.ZERO_TO_ONE, callback.getCardinality());
+ assertNull(callback.getMethodName());
+ assertNull(callback.getParameters());
+
+ cc = controller.install(beanMetaData);
+ assertNotNull(cc);
+ assertEquals(ControllerState.INSTALLED, cc.getState());
+ target = cc.getTarget();
+ assertNotNull(target);
+ bean = assertInstanceOf(target, SimpleCallbackBean.class);
+ assertNotNull(bean.getTransformers());
+ assertEquals(1, bean.getTransformers().size());
+ assertSame(transformer, bean.getTransformers().iterator().next());
+
+ // ct1
+
+ builder = BeanMetaDataBuilder.createBuilder("mct1", SimpleCallbackBean.class.getName());
+ builder.addMethodInstallCallback("addTransformer");
+ builder.addMethodUninstallCallback("removeTransformer");
+ beanMetaData = builder.getBeanMetaData();
+
+ callbacks = beanMetaData.getInstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, InstallCallbackMetaData.class, false);
+ assertEquals("addTransformer", callback.getMethodName());
+ assertEquals(ControllerState.INSTALLED, callback.getDependentState());
+ assertNull(callback.getState());
+ assertNull(callback.getSignature());
+ assertNull(callback.getProperty());
+ assertNull(callback.getCardinality());
+ assertNull(callback.getParameters());
+
+ callbacks = beanMetaData.getUninstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
+ assertEquals("removeTransformer", callback.getMethodName());
+ assertEquals(ControllerState.INSTALLED, callback.getDependentState());
+ assertNull(callback.getState());
+ assertNull(callback.getSignature());
+ assertNull(callback.getProperty());
+ assertNull(callback.getCardinality());
+ assertNull(callback.getParameters());
+
+ cc = controller.install(beanMetaData);
+ assertNotNull(cc);
+ assertEquals(ControllerState.INSTALLED, cc.getState());
+ target = cc.getTarget();
+ assertNotNull(target);
+ bean = assertInstanceOf(target, SimpleCallbackBean.class);
+ assertNotNull(bean.getTransformers());
+ assertEquals(1, bean.getTransformers().size());
+ assertSame(transformer, bean.getTransformers().iterator().next());
+
+ // ct2
+
+ builder = BeanMetaDataBuilder.createBuilder("mct2", SimpleCallbackBean.class.getName());
+ builder.addMethodInstallCallback("addTransformer", Cardinality.ONE_TO_MANY);
+ builder.addMethodUninstallCallback("removeTransformer", Cardinality.ONE_TO_MANY);
+ beanMetaData = builder.getBeanMetaData();
+
+ callbacks = beanMetaData.getInstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, InstallCallbackMetaData.class, false);
+ assertEquals("addTransformer", callback.getMethodName());
+ assertEquals(ControllerState.INSTALLED, callback.getDependentState());
+ assertNull(callback.getState());
+ assertNull(callback.getSignature());
+ assertNull(callback.getProperty());
+ assertEquals(Cardinality.ONE_TO_MANY, callback.getCardinality());
+ assertNull(callback.getParameters());
+
+ callbacks = beanMetaData.getUninstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
+ assertEquals("removeTransformer", callback.getMethodName());
+ assertEquals(ControllerState.INSTALLED, callback.getDependentState());
+ assertNull(callback.getState());
+ assertNull(callback.getSignature());
+ assertNull(callback.getProperty());
+ assertEquals(Cardinality.ONE_TO_MANY, callback.getCardinality());
+ assertNull(callback.getParameters());
+
+ cc = controller.install(beanMetaData);
+ assertNotNull(cc);
+ assertEquals(ControllerState.INSTALLED, cc.getState());
+ target = cc.getTarget();
+ assertNotNull(target);
+ bean = assertInstanceOf(target, SimpleCallbackBean.class);
+ assertNotNull(bean.getTransformers());
+ assertEquals(1, bean.getTransformers().size());
+ assertSame(transformer, bean.getTransformers().iterator().next());
+
+ // ct3
+
+ builder = BeanMetaDataBuilder.createBuilder("mct3", SimpleCallbackBean.class.getName());
+ builder.addMethodInstallCallback("addTransformer", ControllerState.CREATE);
+ builder.addMethodUninstallCallback("removeTransformer", ControllerState.CREATE);
+ beanMetaData = builder.getBeanMetaData();
+
+ callbacks = beanMetaData.getInstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, InstallCallbackMetaData.class, false);
+ assertEquals("addTransformer", callback.getMethodName());
+ assertEquals(ControllerState.INSTALLED, callback.getDependentState());
+ assertEquals(ControllerState.CREATE, callback.getState());
+ assertNull(callback.getSignature());
+ assertNull(callback.getProperty());
+ assertNull(callback.getCardinality());
+ assertNull(callback.getParameters());
+
+ callbacks = beanMetaData.getUninstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
+ assertEquals("removeTransformer", callback.getMethodName());
+ assertEquals(ControllerState.INSTALLED, callback.getDependentState());
+ assertEquals(ControllerState.CREATE, callback.getState());
+ assertNull(callback.getSignature());
+ assertNull(callback.getProperty());
+ assertNull(callback.getCardinality());
+ assertNull(callback.getParameters());
+
+ cc = controller.install(beanMetaData);
+ assertNotNull(cc);
+ assertEquals(ControllerState.INSTALLED, cc.getState());
+ target = cc.getTarget();
+ assertNotNull(target);
+ bean = assertInstanceOf(target, SimpleCallbackBean.class);
+ assertNotNull(bean.getTransformers());
+ assertEquals(1, bean.getTransformers().size());
+ assertSame(transformer, bean.getTransformers().iterator().next());
+
+ // ct4
+
+ builder = BeanMetaDataBuilder.createBuilder("mct4", SimpleCallbackBean.class.getName());
+ builder.addMethodInstallCallback("addTransformer", Transformer.class.getName(), ControllerState.CREATE, ControllerState.START, Cardinality.ZERO_TO_ONE);
+ builder.addMethodUninstallCallback("removeTransformer", Transformer.class.getName(), ControllerState.CREATE, ControllerState.START, Cardinality.ZERO_TO_ONE);
+ beanMetaData = builder.getBeanMetaData();
+
+ callbacks = beanMetaData.getInstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, InstallCallbackMetaData.class, false);
+ assertEquals("addTransformer", callback.getMethodName());
+ assertEquals(ControllerState.START, callback.getDependentState());
+ assertEquals(ControllerState.CREATE, callback.getState());
+ assertEquals(Transformer.class.getName(), callback.getSignature());
+ assertEquals(Cardinality.ZERO_TO_ONE, callback.getCardinality());
+ assertNull(callback.getProperty());
+ assertNull(callback.getParameters());
+
+ callbacks = beanMetaData.getUninstallCallbacks();
+ assertNotNull(callbacks);
+ assertEquals(1, callbacks.size());
+ callback = callbacks.get(0);
+ assertNotNull(callback);
+ assertInstanceOf(callback, UninstallCallbackMetaData.class, false);
+ assertEquals("removeTransformer", callback.getMethodName());
+ assertEquals(ControllerState.START, callback.getDependentState());
+ assertEquals(ControllerState.CREATE, callback.getState());
+ assertEquals(Transformer.class.getName(), callback.getSignature());
+ assertEquals(Cardinality.ZERO_TO_ONE, callback.getCardinality());
+ assertNull(callback.getProperty());
+ assertNull(callback.getParameters());
+
+ cc = controller.install(beanMetaData);
+ assertNotNull(cc);
+ assertEquals(ControllerState.INSTALLED, cc.getState());
+ target = cc.getTarget();
+ assertNotNull(target);
+ bean = assertInstanceOf(target, SimpleCallbackBean.class);
+ assertNotNull(bean.getTransformers());
+ assertEquals(1, bean.getTransformers().size());
+ assertSame(transformer, bean.getTransformers().iterator().next());
+ }
+ finally
+ {
+ controller.shutdown();
+ }
+ }
+
+ public void testAliases() throws Throwable
+ {
+ Kernel kernel = bootstrap();
+ KernelController controller = kernel.getController();
+ try
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("bean", SimpleBean.class.getName());
+ builder.addAlias("alias");
+ controller.install(builder.getBeanMetaData());
+ assertNotNull(controller.getInstalledContext("alias"));
+
+ builder = BeanMetaDataBuilderFactory.createBuilder("other", SimpleBean.class.getName());
+ Object foobar = "foobar";
+ builder.setAliases(Collections.singleton(foobar));
+ controller.install(builder.getBeanMetaData());
+ assertNotNull(controller.getInstalledContext("foobar"));
+ }
+ finally
+ {
+ controller.shutdown();
+ }
+ }
+
+ public void testAnnotations() throws Throwable
+ {
+ Kernel kernel = bootstrap();
+ KernelController controller = kernel.getController();
+ try
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("bean", SimpleBean.class.getName());
+ builder.addAnnotation("@" + SimpleAnnotation.class.getName() + "(name=\"foobar\")");
+ controller.install(builder.getBeanMetaData());
+ ControllerContext cc = controller.getInstalledContext("bean");
+ assertNotNull(cc);
+ MetaData metaData = cc.getScopeInfo().getMetaData();
+ assertNotNull(metaData);
+ assertNotNull(metaData.getAnnotation(SimpleAnnotation.class));
+
+ builder = BeanMetaDataBuilderFactory.createBuilder("other", SimpleBean.class.getName());
+ builder.setAnnotations(Collections.singleton("@" + SimpleAnnotation.class.getName() + "(name=\"foobar\")"));
+ controller.install(builder.getBeanMetaData());
+ cc = controller.getInstalledContext("other");
+ assertNotNull(cc);
+ metaData = cc.getScopeInfo().getMetaData();
+ assertNotNull(metaData);
+ assertNotNull(metaData.getAnnotation(SimpleAnnotation.class));
+ }
+ finally
+ {
+ controller.shutdown();
+ }
+ }
+
+ public void testNewEnums() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(Object.class.getName());
+ builder.setErrorHandlingMode(ErrorHandlingMode.MANUAL);
+ builder.setAutowireType(AutowireType.CONSTRUCTOR);
+ builder.setAutowireCandidate(false);
+
+ BeanMetaData bmd = builder.getBeanMetaData();
+ assertEquals(ErrorHandlingMode.MANUAL, bmd.getErrorHandlingMode());
+ assertEquals(AutowireType.CONSTRUCTOR, bmd.getAutowireType());
+ assertFalse(bmd.isAutowireCandidate());
+ }
+
+ public void testBeanMetaDataFactory() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("bean", Object.class.getName());
+ BeanMetaDataFactory f1 = builder.getBeanMetaDataFactory();
+ assertNotNull(f1);
+ BeanMetaDataFactory f2 = builder.asBeanMetaDataFactory();
+ assertNotNull(f2);
+ List<BeanMetaData> b1 = f1.getBeans();
+ assertNotNull(b1);
+ List<BeanMetaData> b2 = f1.getBeans();
+ assertNotNull(b2);
+ assertEquals(b1, b2);
+
+ AbstractBeanMetaData abmd = new AbstractBeanMetaData("bean", Object.class.getName());
+ builder = BeanMetaDataBuilder.createBuilder(abmd);
+ assertSame(abmd, builder.getBeanMetaDataFactory());
+ BeanMetaDataFactory bmdf = builder.asBeanMetaDataFactory();
+ assertNotNull(bmdf);
+ List<BeanMetaData> beans = bmdf.getBeans();
+ assertNotNull(beans);
+ assertFalse(beans.isEmpty());
+ assertSame(abmd, beans.get(0));
+ }
+
+ public void testRelatedClassName() throws Throwable
+ {
+ RelatedClassMetaData rcmd = new AbstractRelatedClassMetaData(Object.class.getName());
+ Set<RelatedClassMetaData> related = new HashSet<RelatedClassMetaData>();
+ related.add(rcmd);
+
+ BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Bean");
+ builder.addRelatedClass(Object.class.getName());
+ BeanMetaData bmd = builder.getBeanMetaData();
+
+ assertEquals(related, bmd.getRelated());
+ }
+
+ public void testRelatedClassNameWithEnabled() throws Throwable
+ {
+ AbstractRelatedClassMetaData rcmd = new AbstractRelatedClassMetaData(Object.class.getName());
+ rcmd.setEnabledValue("aop");
+ Set<RelatedClassMetaData> related = new HashSet<RelatedClassMetaData>();
+ related.add(rcmd);
+
+ BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Bean");
+ builder.addRelatedClass(Object.class.getName(), "aop");
+ BeanMetaData bmd = builder.getBeanMetaData();
+
+ assertEquals(related, bmd.getRelated());
+ }
+
+ public void testMultipleRelatedClassNameWithMultipleEnabled() throws Throwable
+ {
+ AbstractRelatedClassMetaData rcmd1 = new AbstractRelatedClassMetaData(Object.class.getName());
+ rcmd1.setEnabled(new HashSet<Object>(Arrays.asList("aop", "md")));
+ AbstractRelatedClassMetaData rcmd2 = new AbstractRelatedClassMetaData(String.class.getName());
+ rcmd2.setEnabled(new HashSet<Object>(Arrays.asList("qwert", "foobar")));
+
+ Set<RelatedClassMetaData> related = new HashSet<RelatedClassMetaData>();
+ related.add(rcmd1);
+ related.add(rcmd2);
+
+ BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Bean");
+ builder.addRelatedClass(Object.class.getName(), "aop", "md");
+ builder.addRelatedClass(String.class.getName(), "qwert", "foobar");
+ BeanMetaData bmd = builder.getBeanMetaData();
+
+ assertEquals(related, bmd.getRelated());
+ }
+
+ public void testIgnoredLifecycle() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("test");
+ builder.ignoreCreate();
+ builder.ignoreStart();
+ builder.ignoreStop();
+ builder.ignoreDestroy();
+ BeanMetaData bmd = builder.getBeanMetaData();
+ assertIgnoredLifecycle(bmd.getCreate());
+ assertIgnoredLifecycle(bmd.getStart());
+ assertIgnoredLifecycle(bmd.getStop());
+ assertIgnoredLifecycle(bmd.getDestroy());
+ }
+
+ protected void assertIgnoredLifecycle(LifecycleMetaData lmd)
+ {
+ assertNotNull(lmd);
+ assertTrue(lmd.isIgnored());
+ }
+
+ public void testContextualInjection() throws Throwable
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("test");
+ builder.addPropertyMetaData("ci", builder.createContextualInject());
+ BeanMetaData bmd = builder.getBeanMetaData();
+ Set<PropertyMetaData> properties = bmd.getProperties();
+ assertNotNull(properties);
+ assertEquals(1, properties.size());
+ PropertyMetaData pmd = properties.iterator().next();
+ ValueMetaData vmd = pmd.getValue();
+ assertNotNull(vmd);
+ assertNull(vmd.getUnderlyingValue());
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/PrivilegedBean.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/controller/support/PrivilegedBean.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/PrivilegedBean.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,36 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, 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.kernel.controller.support;
-
-/**
- * PrivilegedBean.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public class PrivilegedBean
-{
- public PrivilegedBean()
- {
- System.getProperties();
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/PrivilegedBean.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/controller/support/PrivilegedBean.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/PrivilegedBean.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/PrivilegedBean.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, 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.kernel.controller.support;
+
+/**
+ * PrivilegedBean.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class PrivilegedBean
+{
+ public PrivilegedBean()
+ {
+ System.getProperties();
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/SimpleScopedClassLoader.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/controller/support/SimpleScopedClassLoader.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/SimpleScopedClassLoader.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,88 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, 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.kernel.controller.support;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.ProtectionDomain;
-
-import org.jboss.test.AbstractTestCaseWithSetup;
-
-/**
- * SimpleScopedClassLoader.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public class SimpleScopedClassLoader extends ClassLoader
-{
- @Override
- protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
- {
- if (name.startsWith("org.jboss.test.kernel"))
- {
- SecurityManager sm = AbstractTestCaseWithSetup.suspendSecurity();
- try
- {
- String resourceName = name.replace('.', '/') + ".class";
- URL url = SimpleScopedClassLoader.class.getClassLoader().getResource(resourceName);
- InputStream is = null;
- byte[] bytes = null;
- try
- {
- is = url.openStream();
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- byte[] tmp = new byte[1024];
- int read = 0;
- while ( (read = is.read(tmp)) >= 0 )
- baos.write(tmp, 0, read);
- bytes = baos.toByteArray();
- }
- catch (IOException e)
- {
- throw new RuntimeException("Unable to load class byte code " + name, e);
- }
- finally
- {
- try
- {
- if (is != null)
- is.close();
- }
- catch (IOException e)
- {
- // pointless
- }
- }
- ProtectionDomain pd = AbstractTestCaseWithSetup.class.getProtectionDomain();
- return defineClass(name, bytes, 0, bytes.length, pd);
- }
- finally
- {
- AbstractTestCaseWithSetup.resumeSecurity(sm);
- }
- }
- return super.loadClass(name, resolve);
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/SimpleScopedClassLoader.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/controller/support/SimpleScopedClassLoader.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/SimpleScopedClassLoader.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/support/SimpleScopedClassLoader.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,88 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, 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.kernel.controller.support;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.security.ProtectionDomain;
+
+import org.jboss.test.AbstractTestCaseWithSetup;
+
+/**
+ * SimpleScopedClassLoader.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleScopedClassLoader extends ClassLoader
+{
+ @Override
+ protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
+ {
+ if (name.startsWith("org.jboss.test.kernel"))
+ {
+ SecurityManager sm = AbstractTestCaseWithSetup.suspendSecurity();
+ try
+ {
+ String resourceName = name.replace('.', '/') + ".class";
+ URL url = SimpleScopedClassLoader.class.getClassLoader().getResource(resourceName);
+ InputStream is = null;
+ byte[] bytes = null;
+ try
+ {
+ is = url.openStream();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ byte[] tmp = new byte[1024];
+ int read = 0;
+ while ( (read = is.read(tmp)) >= 0 )
+ baos.write(tmp, 0, read);
+ bytes = baos.toByteArray();
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Unable to load class byte code " + name, e);
+ }
+ finally
+ {
+ try
+ {
+ if (is != null)
+ is.close();
+ }
+ catch (IOException e)
+ {
+ // pointless
+ }
+ }
+ ProtectionDomain pd = AbstractTestCaseWithSetup.class.getProtectionDomain();
+ return defineClass(name, bytes, 0, bytes.length, pd);
+ }
+ finally
+ {
+ AbstractTestCaseWithSetup.resumeSecurity(sm);
+ }
+ }
+ return super.loadClass(name, resolve);
+ }
+}
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,90 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.kernel.controller.test;
-
-import java.security.AccessControlException;
-import java.util.Collections;
-
-import junit.framework.Test;
-
-import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
-import org.jboss.beans.metadata.spi.factory.BeanFactory;
-import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData;
-import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
-import org.jboss.test.kernel.controller.support.PrivilegedBean;
-
-/**
- * AccessControl Test Case.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 38046 $
- */
-public class GenericBeanFactoryAccessControlTestCase extends AbstractControllerTest
-{
- public static Test suite()
- {
- return suite(GenericBeanFactoryAccessControlTestCase.class);
- }
-
- public GenericBeanFactoryAccessControlTestCase(String name) throws Throwable
- {
- super(name);
- }
-
- public void testPrivilegedBean() throws Throwable
- {
- BeanFactory factory = assertBean("Factory", BeanFactory.class);
- Object object = factory.createBean();
-
- ClassLoader cl = assertBean("ClassLoader", ClassLoader.class);
- assertEquals(cl, object.getClass().getClassLoader());
- }
-
- public void testUnPrivilegedBean() throws Throwable
- {
- GenericBeanFactoryMetaData gbfmd = new GenericBeanFactoryMetaData();
- gbfmd.setName("NonPrivileged");
- gbfmd.setBean(PrivilegedBean.class.getName());
-
- AbstractKernelDeployment deployment = new AbstractKernelDeployment();
- deployment.setName("test");
- deployment.setBeanFactories(Collections.singletonList((BeanMetaDataFactory) gbfmd));
- deploy(deployment);
- try
- {
- BeanFactory factory = assertBean("NonPrivileged", BeanFactory.class);
- try
- {
- factory.createBean();
- fail("Should not be here!");
- }
- catch (Throwable t)
- {
- checkThrowable(AccessControlException.class, t);
- }
- }
- finally
- {
- undeploy(deployment);
- }
- }
-}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,90 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, 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.kernel.controller.test;
+
+import java.security.AccessControlException;
+import java.util.Collections;
+
+import junit.framework.Test;
+
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.beans.metadata.spi.factory.BeanFactory;
+import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData;
+import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
+import org.jboss.test.kernel.controller.support.PrivilegedBean;
+
+/**
+ * AccessControl Test Case.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 38046 $
+ */
+public class GenericBeanFactoryAccessControlTestCase extends AbstractControllerTest
+{
+ public static Test suite()
+ {
+ return suite(GenericBeanFactoryAccessControlTestCase.class);
+ }
+
+ public GenericBeanFactoryAccessControlTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ public void testPrivilegedBean() throws Throwable
+ {
+ BeanFactory factory = assertBean("Factory", BeanFactory.class);
+ Object object = factory.createBean();
+
+ ClassLoader cl = assertBean("ClassLoader", ClassLoader.class);
+ assertEquals(cl, object.getClass().getClassLoader());
+ }
+
+ public void testUnPrivilegedBean() throws Throwable
+ {
+ GenericBeanFactoryMetaData gbfmd = new GenericBeanFactoryMetaData();
+ gbfmd.setName("NonPrivileged");
+ gbfmd.setBean(PrivilegedBean.class.getName());
+
+ AbstractKernelDeployment deployment = new AbstractKernelDeployment();
+ deployment.setName("test");
+ deployment.setBeanFactories(Collections.singletonList((BeanMetaDataFactory) gbfmd));
+ deploy(deployment);
+ try
+ {
+ BeanFactory factory = assertBean("NonPrivileged", BeanFactory.class);
+ try
+ {
+ factory.createBean();
+ fail("Should not be here!");
+ }
+ catch (Throwable t)
+ {
+ checkThrowable(AccessControlException.class, t);
+ }
+ }
+ finally
+ {
+ undeploy(deployment);
+ }
+ }
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FirstBean.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FirstBean.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FirstBean.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FirstBean.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.kernel.deployment.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class FirstBean
+{
+ private RealTM tm;
+ private boolean flag;
+
+ public RealTM getTm()
+ {
+ return tm;
+ }
+
+ public void setTm(RealTM tm)
+ {
+ // tm == null means we're uniconfiguring
+ // the flag should be there from SecondBean's uninstall
+ if (tm == null && flag == false)
+ throw new IllegalArgumentException("Should be marked from SecondBean");
+
+ this.tm = tm;
+ }
+
+ void markSecondUninstall()
+ {
+ flag = true;
+ }
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/GetInstanceBean.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/support/GetInstanceBean.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/GetInstanceBean.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/GetInstanceBean.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,39 @@
+/*
+* 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.kernel.deployment.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class GetInstanceBean
+{
+ private static final GetInstanceBean instance = new GetInstanceBean("X");
+
+ private GetInstanceBean(String x)
+ {
+ }
+
+ public static GetInstanceBean getInstance()
+ {
+ return instance;
+ }
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/HAPartition.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/support/HAPartition.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/HAPartition.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/HAPartition.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,47 @@
+/*
+* 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.kernel.deployment.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class HAPartition
+{
+ private boolean started;
+ @SuppressWarnings("unused")
+ private HAPartitionCacheHandler handler;
+
+ public void start()
+ {
+ started = true;
+ }
+
+ public boolean isStarted()
+ {
+ return started;
+ }
+
+ public void setHandler(HAPartitionCacheHandler handler)
+ {
+ handler.setPartition(this);
+ }
+}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/HAPartitionCacheHandler.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/support/HAPartitionCacheHandler.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/HAPartitionCacheHandler.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/HAPartitionCacheHandler.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,43 @@
+/*
+* 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.kernel.deployment.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class HAPartitionCacheHandler
+{
+ private HAPartition partition;
+
+ public void setPartition(HAPartition partition)
+ {
+ this.partition = partition;
+ }
+
+ public String getCache()
+ {
+ if (partition == null || partition.isStarted() == false)
+ throw new IllegalArgumentException("HAPartition not started!");
+
+ return "some-cache";
+ }
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/RealTM.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/support/RealTM.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/RealTM.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/RealTM.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.kernel.deployment.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class RealTM
+{
+}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SecondBean.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SecondBean.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SecondBean.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SecondBean.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.kernel.deployment.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class SecondBean
+{
+ private FirstBean firstBean;
+
+ public FirstBean getFirstBean()
+ {
+ return firstBean;
+ }
+
+ public void setFirstBean(FirstBean firstBean)
+ {
+ if (firstBean == null)
+ this.firstBean.markSecondUninstall();
+
+ this.firstBean = firstBean;
+ }
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SomeCacheTreeManager.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SomeCacheTreeManager.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SomeCacheTreeManager.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SomeCacheTreeManager.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,40 @@
+/*
+* 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.kernel.deployment.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SomeCacheTreeManager
+{
+ private String clusteredCache;
+
+ public String getClusteredCache()
+ {
+ return clusteredCache;
+ }
+
+ public void setClusteredCache(String clusteredCache)
+ {
+ this.clusteredCache = clusteredCache;
+ }
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemand.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemand.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemand.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemand.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,41 @@
+/*
+* 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.kernel.deployment.support;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Target(ElementType.TYPE)
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface SuperDemand
+{
+ String demand();
+
+ String whenRequired() default "Instantiated";
+
+ String dependentState() default "Installed";
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemandAnnotationPlugin.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemandAnnotationPlugin.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemandAnnotationPlugin.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemandAnnotationPlugin.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,53 @@
+/*
+* 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.kernel.deployment.support;
+
+import java.util.List;
+
+import org.jboss.beans.metadata.spi.MetaDataVisitorNode;
+import org.jboss.dependency.spi.DependencyInfo;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.plugins.AbstractDependencyItem;
+import org.jboss.kernel.plugins.annotations.ClassAnnotationPlugin;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.reflect.spi.ClassInfo;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SuperDemandAnnotationPlugin extends ClassAnnotationPlugin<SuperDemand>
+{
+ public SuperDemandAnnotationPlugin()
+ {
+ super(SuperDemand.class);
+ }
+
+ protected List<? extends MetaDataVisitorNode> internalApplyAnnotation(ClassInfo info, MetaData retrieval, SuperDemand annotation, KernelControllerContext context) throws Throwable
+ {
+ DependencyInfo di = context.getDependencyInfo();
+ DependencyItem item = new AbstractDependencyItem(context.getName(), annotation.demand(), new ControllerState(annotation.whenRequired()), new ControllerState(annotation.dependentState()));
+ di.addIDependOn(item);
+ return null;
+ }
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemandCreator.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemandCreator.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemandCreator.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemandCreator.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,57 @@
+/*
+* 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.kernel.deployment.support;
+
+import org.jboss.beans.metadata.api.annotations.Constructor;
+import org.jboss.beans.metadata.api.annotations.Inject;
+import org.jboss.dependency.plugins.AbstractDependencyItem;
+import org.jboss.dependency.spi.Controller;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.DependencyInfo;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SuperDemandCreator
+{
+ private Controller controller;
+
+ @Constructor
+ public SuperDemandCreator(@Inject(bean = KernelConstants.KERNEL_CONTROLLER_NAME) Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void createDependency(String name, String demand, String whenRequired, String dependentState)
+ {
+ ControllerContext context = controller.getContext(name, null);
+ if (context == null)
+ throw new IllegalArgumentException("Cannot find context: " + name);
+
+ DependencyInfo di = context.getDependencyInfo();
+ DependencyItem item = new AbstractDependencyItem(context.getName(), demand, new ControllerState(whenRequired), new ControllerState(dependentState));
+ di.addIDependOn(item);
+ }
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,57 @@
+/*
+* 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.kernel.deployment.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.api.annotations.Inject;
+import org.jboss.test.kernel.junit.MicrocontainerTest;
+
+/**
+ * AliasInjectTestCase
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AliasInjectTestCase extends MicrocontainerTest
+{
+ private Object injectee;
+
+ public AliasInjectTestCase(String name) throws Throwable
+ {
+ super(name, true);
+ }
+
+ public static Test suite()
+ {
+ return suite(AliasInjectTestCase.class);
+ }
+
+ public void testDepends() throws Throwable
+ {
+ assertNotNull(injectee);
+ }
+
+ @Inject(bean = "InjecteeFactory", property = "serviceName")
+ public void setInjectee(Object injectee)
+ {
+ this.injectee = injectee;
+ }
+}
\ No newline at end of file
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,89 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.kernel.deployment.test;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * Deployment Test Suite.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision$
- */
-public class DeploymentTestSuite extends TestSuite
-{
- public static void main(String[] args)
- {
- TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Deployment Tests");
-
- suite.addTest(BeanMetaDataTestCase.suite());
- suite.addTest(BeanMetaDataWithClassloaderTestCase.suite());
- suite.addTest(DeploymentClassLoaderTestCase.suite());
- suite.addTest(GenericBeanFactoryLifecycleTestCase.suite());
- suite.addTest(WildcardClassLoaderTestCase.suite());
- suite.addTest(BeanMetaDataFactoryTestCase.suite());
- suite.addTest(AnnotatedLifecycleTestCase.suite());
- suite.addTest(IgnoredAnnotatedLifecycleTestCase.suite());
- suite.addTest(IgnoredLifecycleTestCase.suite());
- suite.addTest(IgnoredFactoryLifecycleTestCase.suite());
- suite.addTest(MixedLifecycleTestCase.suite());
- suite.addTest(FineGrainedActionTestCase.suite());
- suite.addTest(ScopingTestCase.suite());
- suite.addTest(AnnotatedDeploymentScopingTestCase.suite());
- suite.addTest(IllegalScopingTestCase.suite());
- suite.addTest(AnnotatedClassesScopingTestCase.suite());
- suite.addTest(ContextualScopingTestCase.suite());
- suite.addTest(InnerBeanScopingTestCase.suite());
- suite.addTest(ScopingShutdownTestCase.suite());
- suite.addTest(FromContextUnsupportedTestCase.suite());
- suite.addTest(InCallbackInstantiatedTestCase.suite());
- suite.addTest(AnonymousBeansTestCase.suite());
- suite.addTest(AnonymousBeansXMLTestCase.suite());
- suite.addTest(MutableMetaDataTestCase.suite());
- suite.addTest(AnnotationRedeployTestCase.suite());
- suite.addTest(MockServiceBindingTestCase.suite());
- suite.addTest(AnnotationUsageTestCase.suite());
- suite.addTest(PropertyUsageTestCase.suite());
- suite.addTest(NullifyTestCase.suite());
- // bean container tests
- suite.addTest(BeanContainerUsageTestCase.suite());
- suite.addTest(BeanContainerUsageMDTestCase.suite());
- suite.addTest(BeanContainerScopingTestCase.suite());
- suite.addTest(BeanContainerInjectionTestCase.suite());
- suite.addTest(BeanContainerStaticTestCase.suite());
- suite.addTest(BeanContainerSetDemandTestCase.suite());
- // scoping alias tests
- suite.addTest(ScopingAliasTestCase.suite());
- suite.addTest(ScopingAliasAPITestCase.suite());
- suite.addTest(ScopingOverrideTestCase.suite());
- suite.addTest(ScopingDependencyTestCase.suite());
-
- return suite;
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,96 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, 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.kernel.deployment.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * Deployment Test Suite.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public class DeploymentTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("Deployment Tests");
+
+ suite.addTest(BeanMetaDataTestCase.suite());
+ suite.addTest(BeanMetaDataWithClassloaderTestCase.suite());
+ suite.addTest(DeploymentClassLoaderTestCase.suite());
+ suite.addTest(GenericBeanFactoryLifecycleTestCase.suite());
+ suite.addTest(WildcardClassLoaderTestCase.suite());
+ suite.addTest(BeanMetaDataFactoryTestCase.suite());
+ suite.addTest(AnnotatedLifecycleTestCase.suite());
+ suite.addTest(IgnoredAnnotatedLifecycleTestCase.suite());
+ suite.addTest(IgnoredLifecycleTestCase.suite());
+ suite.addTest(IgnoredFactoryLifecycleTestCase.suite());
+ suite.addTest(MixedLifecycleTestCase.suite());
+ suite.addTest(FineGrainedActionTestCase.suite());
+ suite.addTest(ScopingTestCase.suite());
+ suite.addTest(AnnotatedDeploymentScopingTestCase.suite());
+ suite.addTest(IllegalScopingTestCase.suite());
+ suite.addTest(AnnotatedClassesScopingTestCase.suite());
+ suite.addTest(ContextualScopingTestCase.suite());
+ suite.addTest(InnerBeanScopingTestCase.suite());
+ suite.addTest(ScopingShutdownTestCase.suite());
+ suite.addTest(FromContextUnsupportedTestCase.suite());
+ suite.addTest(InCallbackInstantiatedTestCase.suite());
+ suite.addTest(AnonymousBeansTestCase.suite());
+ suite.addTest(AnonymousBeansXMLTestCase.suite());
+ suite.addTest(MutableMetaDataTestCase.suite());
+ suite.addTest(AnnotationRedeployTestCase.suite());
+ suite.addTest(MockServiceBindingTestCase.suite());
+ suite.addTest(MockEjb3DependsTestCase.suite());
+ suite.addTest(AnnotationUsageTestCase.suite());
+ suite.addTest(PropertyUsageTestCase.suite());
+ suite.addTest(AliasInjectTestCase.suite());
+ suite.addTest(GetInstanceTestCase.suite());
+ suite.addTest(NullifyTestCase.suite());
+ suite.addTest(TransitiveBeansTestCase.suite());
+ // bean container tests
+ suite.addTest(BeanContainerUsageTestCase.suite());
+ suite.addTest(BeanContainerUsageMDTestCase.suite());
+ suite.addTest(BeanContainerScopingTestCase.suite());
+ suite.addTest(BeanContainerInjectionTestCase.suite());
+ suite.addTest(BeanContainerStaticTestCase.suite());
+ suite.addTest(BeanContainerSetDemandTestCase.suite());
+ // scoping alias tests
+ suite.addTest(ScopingAliasTestCase.suite());
+ suite.addTest(ScopingAliasAPITestCase.suite());
+ suite.addTest(ScopingOverrideTestCase.suite());
+ suite.addTest(ScopingDependencyTestCase.suite());
+ // super-demand
+ suite.addTest(SuperDemandAnnotationTestCase.suite());
+ suite.addTest(SuperDemandInstallTestCase.suite());
+
+ return suite;
+ }
+}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/GetInstanceTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/test/GetInstanceTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/GetInstanceTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/GetInstanceTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,48 @@
+/*
+* 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.kernel.deployment.test;
+
+import junit.framework.Test;
+import org.jboss.test.kernel.junit.MicrocontainerTest;
+
+/**
+ * GetInstanceTestCase
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class GetInstanceTestCase extends MicrocontainerTest
+{
+ public GetInstanceTestCase(String name) throws Throwable
+ {
+ super(name, true);
+ }
+
+ public static Test suite()
+ {
+ return suite(GetInstanceTestCase.class);
+ }
+
+ public void testGetInstance() throws Throwable
+ {
+ assertBean("GetInstance", Object.class);
+ }
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/MockEjb3DependsTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/test/MockEjb3DependsTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/MockEjb3DependsTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/MockEjb3DependsTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,48 @@
+/*
+* 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.kernel.deployment.test;
+
+import junit.framework.Test;
+import org.jboss.test.kernel.deployment.support.SimpleBean;
+
+/**
+ * MockEjb3DependsTestCase: JBMICROCONT-365
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class MockEjb3DependsTestCase extends AbstractDeploymentTest
+{
+ public MockEjb3DependsTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(MockEjb3DependsTestCase.class);
+ }
+
+ public void testDepends() throws Throwable
+ {
+ assertBean("EJB", SimpleBean.class);
+ }
+}
\ No newline at end of file
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingDependencyTestCase.java
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingDependencyTestCase.java 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingDependencyTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,327 +0,0 @@
-/*
-* 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.kernel.deployment.test;
-
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.Test;
-import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.ValueMetaData;
-import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.kernel.spi.deployment.KernelDeployment;
-import org.jboss.test.kernel.deployment.support.AliasesImpl;
-import org.jboss.test.kernel.deployment.support.ApplicationScopeImpl;
-import org.jboss.test.kernel.deployment.support.SimpleBeanImpl;
-import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean;
-
-/**
- * Scoping dependency tests.
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- * @version $Revision: 1.1 $
- */
-public class ScopingDependencyTestCase extends ScopingDeploymentTest
-{
- private final static String PARENT_CLASS = SimpleBeanImpl.class.getName();
-
- private final static String CHILD_CLASS = SimpleObjectWithBean.class.getName();
-
- private final static String PARENT = "Parent";
-
- private final static String CHILD = "Child";
-
- private final static String SCOPED_PARENT = "Scoped_Parent";
-
- private final static String APP_SCOPE_1 = "scoped1";
-
- private final static String APP_SCOPE_2 = "scoped2";
-
- public ScopingDependencyTestCase(String name) throws Throwable
- {
- super(name);
- }
-
- public static Test suite()
- {
- return suite(ScopingDependencyTestCase.class);
- }
-
- public void testScopedChildDependencyOnParent() throws Throwable
- {
- KernelDeployment childDeployment = createChildDeployment(CHILD, PARENT, APP_SCOPE_1, null);
- deploy(childDeployment);
-
- try
- {
- assertNoSuchContext(CHILD);
-
- KernelDeployment parentDeployment = createParentDeployment();
- deploy(parentDeployment);
-
- try
- {
- ControllerContext parent = getControllerContext(PARENT);
- ControllerContext child = getControllerContext(CHILD);
- assertNotSame(parent.getController(), child.getController());
- }
- finally
- {
- undeploy(parentDeployment);
- }
- assertNoSuchContext(PARENT);
- assertNoSuchContext(CHILD);
- }
- finally
- {
- undeploy(childDeployment);
- }
- }
-
- public void testScopedChildWithDependencyOnAliasInScopedControllerWithSameNameAsParent() throws Throwable
- {
- KernelDeployment childDeployment = createChildDeployment(CHILD, PARENT, APP_SCOPE_1, null);
- deploy(childDeployment);
-
- try
- {
- assertNoSuchContext(CHILD);
-
- KernelDeployment parentInChildScopeDeployment = createDeployment(SCOPED_PARENT, PARENT_CLASS, null, APP_SCOPE_1, PARENT);
-
- deploy(parentInChildScopeDeployment);
- try
- {
- ControllerContext scopedParent = getControllerContext(SCOPED_PARENT);
- ControllerContext child = getControllerContext(CHILD);
- assertSame(scopedParent.getController(), child.getController());
-
- KernelDeployment parentDeployment = createParentDeployment();
- deploy(parentDeployment);
- try
- {
- ControllerContext parent = getControllerContext(PARENT);
- assertNotSame(parent.getController(), child.getController());
- }
- finally
- {
- undeploy(parentDeployment);
- }
- scopedParent = getControllerContext(SCOPED_PARENT);
- child = getControllerContext(CHILD);
- }
- finally
- {
- undeploy(parentInChildScopeDeployment);
- }
- assertNoSuchContext(CHILD);
- }
- finally
- {
- undeploy(childDeployment);
- }
- }
-
- public void testScopedChildWithNoDependencyAndGlobalChildWithDependencyOnParent() throws Throwable
- {
- KernelDeployment childDeploymentNoDependencies = createChildDeployment(CHILD, null, APP_SCOPE_2, null);
- deploy(childDeploymentNoDependencies);
- try
- {
- List<KernelControllerContext> contextsNoDependencies = childDeploymentNoDependencies.getInstalledContexts();
- assertEquals(1, contextsNoDependencies.size());
- KernelControllerContext childNoDependencies = contextsNoDependencies.get(0);
- assertEquals(ControllerState.INSTALLED, childNoDependencies.getState());
-
- KernelDeployment childDeploymentWithDependencies = createChildDeployment(CHILD + 1, CHILD, PARENT, APP_SCOPE_1, null);
- deploy(childDeploymentWithDependencies);
- try
- {
- List<KernelControllerContext> contextsWithDependencies = childDeploymentWithDependencies.getInstalledContexts();
- assertEquals(1, contextsWithDependencies.size());
- KernelControllerContext childWithDependencies = contextsWithDependencies.get(0);
- assertFalse(ControllerState.INSTALLED.equals(childWithDependencies.getState()));
- assertNotSame(childNoDependencies.getController(), childWithDependencies.getController());
-
- KernelDeployment parentDeployment = createParentDeployment();
- deploy(parentDeployment);
- try
- {
- ControllerContext parent = getControllerContext(PARENT);
- ControllerContext child = getControllerContext(CHILD);
- assertNotSame(parent.getController(), child.getController());
- assertNotSame(parent.getController(), childNoDependencies.getController());
- assertNotSame(parent.getController(), childWithDependencies.getController());
- assertEquals(ControllerState.INSTALLED, childNoDependencies.getState());
- }
- finally
- {
- undeploy(parentDeployment);
- }
- assertNoSuchContext(PARENT);
- assertFalse(ControllerState.INSTALLED.equals(childWithDependencies.getState()));
- // unwinded due to the same name
- assertFalse(ControllerState.INSTALLED.equals(childNoDependencies.getState()));
- }
- finally
- {
- undeploy(childDeploymentWithDependencies);
- }
- }
- finally
- {
- undeploy(childDeploymentNoDependencies);
- }
- }
-
- public void testScopedChildWithNoDependencyAndGlobalChildWithDependencyOnParentViaAliases() throws Throwable
- {
- KernelDeployment childDeploymentNoDependencies = createChildDeployment(CHILD + 1, null, APP_SCOPE_2, CHILD);
- deploy(childDeploymentNoDependencies);
- try
- {
- List<KernelControllerContext> contextsNoDependencies = childDeploymentNoDependencies.getInstalledContexts();
- assertEquals(1, contextsNoDependencies.size());
- KernelControllerContext childNoDependencies = contextsNoDependencies.get(0);
- assertEquals(ControllerState.INSTALLED, childNoDependencies.getState());
-
- KernelDeployment childDeploymentWithDependencies = createChildDeployment(CHILD + 2, CHILD + 2, PARENT, APP_SCOPE_1, CHILD);
- deploy(childDeploymentWithDependencies);
- try
- {
- List<KernelControllerContext> contextsWithDependencies = childDeploymentWithDependencies.getInstalledContexts();
- assertEquals(1, contextsWithDependencies.size());
- KernelControllerContext childWithDependencies = contextsWithDependencies.get(0);
- assertFalse(ControllerState.INSTALLED.equals(childWithDependencies.getState()));
- assertNotSame(childNoDependencies.getController(), childWithDependencies.getController());
-
- KernelDeployment parentDeployment = createParentDeployment();
- deploy(parentDeployment);
- try
- {
- ControllerContext parent = getControllerContext(PARENT);
- ControllerContext child = getControllerContext(CHILD);
- assertNotSame(parent.getController(), child.getController());
- assertNotSame(parent.getController(), childNoDependencies.getController());
- assertNotSame(parent.getController(), childWithDependencies.getController());
- assertEquals(ControllerState.INSTALLED, childNoDependencies.getState());
- }
- finally
- {
- undeploy(parentDeployment);
- }
- assertNoSuchContext(PARENT);
- assertFalse(ControllerState.INSTALLED.equals(childWithDependencies.getState()));
- assertEquals(ControllerState.INSTALLED, childNoDependencies.getState());
- }
- finally
- {
- undeploy(childDeploymentWithDependencies);
- }
- }
- finally
- {
- undeploy(childDeploymentNoDependencies);
- }
- }
-
- public void testTwoScopedChildrenOneWithDependencyOnParent() throws Throwable
- {
- runTestTwoScopedChildrenWithDependencyOnParent(false);
- }
-
- public void testTwoScopedChildrenOneWithDependencyOnParentReverseOrder() throws Throwable
- {
- runTestTwoScopedChildrenWithDependencyOnParent(true);
- }
-
- private void runTestTwoScopedChildrenWithDependencyOnParent(boolean withDependencyFirst) throws Throwable
- {
- //TODO this will not work until Abstract
- }
-
- private KernelDeployment createParentDeployment() throws Throwable
- {
- return createDeployment(PARENT, PARENT_CLASS, null, null, null);
- }
-
- private KernelDeployment createChildDeployment(String beanName, String dependency, String scope, String alias)
- {
- return createChildDeployment(beanName, beanName, dependency, scope, alias);
- }
-
- private KernelDeployment createChildDeployment(String deploymentName, String beanName, String dependency, String scope, String alias)
- {
- return createDeployment(deploymentName, beanName, CHILD_CLASS, dependency, scope, alias);
- }
-
- private KernelDeployment createDeployment(String beanName, String clazz, String dependency, String scope, String alias)
- {
- return createDeployment(beanName, beanName, clazz, dependency, scope, alias);
- }
-
- @SuppressWarnings({"deprecation"})
- private KernelDeployment createDeployment(String deploymentName, String beanName, String clazz, String dependency, String scope, String alias)
- {
- BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(beanName, clazz);
- if (dependency != null)
- {
- ValueMetaData inject = builder.createInject(dependency);
- builder.addPropertyMetaData("simpleBean", inject);
- }
- if (scope != null)
- {
- builder.addAnnotation(new ApplicationScopeImpl(scope));
- }
- if (alias != null)
- {
- builder.addAnnotation(new AliasesImpl(alias));
- }
-
- AbstractKernelDeployment deployment = new AbstractKernelDeployment();
- deployment.setName(deploymentName);
- List<BeanMetaData> beans = Collections.singletonList(builder.getBeanMetaData());
- deployment.setBeans(beans);
- return deployment;
- }
-
- /**
- * assertNoControllerContext() never fails for scoped beans whether installed or not, so use this instead
- */
- private void assertNoSuchContext(String name)
- {
- try
- {
- getControllerContext(name);
- fail(name + " should not be found");
- }
- catch (IllegalStateException e)
- {
- }
- }
-}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingDependencyTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingDependencyTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingDependencyTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingDependencyTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,327 @@
+/*
+* 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.kernel.deployment.test;
+
+import java.util.Collections;
+import java.util.List;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.test.kernel.deployment.support.AliasesImpl;
+import org.jboss.test.kernel.deployment.support.ApplicationScopeImpl;
+import org.jboss.test.kernel.deployment.support.SimpleBeanImpl;
+import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean;
+
+/**
+ * Scoping dependency tests.
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ * @version $Revision: 1.1 $
+ */
+public class ScopingDependencyTestCase extends ScopingDeploymentTest
+{
+ private final static String PARENT_CLASS = SimpleBeanImpl.class.getName();
+
+ private final static String CHILD_CLASS = SimpleObjectWithBean.class.getName();
+
+ private final static String PARENT = "Parent";
+
+ private final static String CHILD = "Child";
+
+ private final static String SCOPED_PARENT = "Scoped_Parent";
+
+ private final static String APP_SCOPE_1 = "scoped1";
+
+ private final static String APP_SCOPE_2 = "scoped2";
+
+ public ScopingDependencyTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(ScopingDependencyTestCase.class);
+ }
+
+ public void testScopedChildDependencyOnParent() throws Throwable
+ {
+ KernelDeployment childDeployment = createChildDeployment(CHILD, PARENT, APP_SCOPE_1, null);
+ deploy(childDeployment);
+
+ try
+ {
+ assertNoSuchContext(CHILD);
+
+ KernelDeployment parentDeployment = createParentDeployment();
+ deploy(parentDeployment);
+
+ try
+ {
+ ControllerContext parent = getControllerContext(PARENT);
+ ControllerContext child = getControllerContext(CHILD);
+ assertNotSame(parent.getController(), child.getController());
+ }
+ finally
+ {
+ undeploy(parentDeployment);
+ }
+ assertNoSuchContext(PARENT);
+ assertNoSuchContext(CHILD);
+ }
+ finally
+ {
+ undeploy(childDeployment);
+ }
+ }
+
+ public void testScopedChildWithDependencyOnAliasInScopedControllerWithSameNameAsParent() throws Throwable
+ {
+ KernelDeployment childDeployment = createChildDeployment(CHILD, PARENT, APP_SCOPE_1, null);
+ deploy(childDeployment);
+
+ try
+ {
+ assertNoSuchContext(CHILD);
+
+ KernelDeployment parentInChildScopeDeployment = createDeployment(SCOPED_PARENT, PARENT_CLASS, null, APP_SCOPE_1, PARENT);
+
+ deploy(parentInChildScopeDeployment);
+ try
+ {
+ ControllerContext scopedParent = getControllerContext(SCOPED_PARENT);
+ ControllerContext child = getControllerContext(CHILD);
+ assertSame(scopedParent.getController(), child.getController());
+
+ KernelDeployment parentDeployment = createParentDeployment();
+ deploy(parentDeployment);
+ try
+ {
+ ControllerContext parent = getControllerContext(PARENT);
+ assertNotSame(parent.getController(), child.getController());
+ }
+ finally
+ {
+ undeploy(parentDeployment);
+ }
+ scopedParent = getControllerContext(SCOPED_PARENT);
+ child = getControllerContext(CHILD);
+ }
+ finally
+ {
+ undeploy(parentInChildScopeDeployment);
+ }
+ assertNoSuchContext(CHILD);
+ }
+ finally
+ {
+ undeploy(childDeployment);
+ }
+ }
+
+ public void testScopedChildWithNoDependencyAndGlobalChildWithDependencyOnParent() throws Throwable
+ {
+ KernelDeployment childDeploymentNoDependencies = createChildDeployment(CHILD, null, APP_SCOPE_2, null);
+ deploy(childDeploymentNoDependencies);
+ try
+ {
+ List<KernelControllerContext> contextsNoDependencies = childDeploymentNoDependencies.getInstalledContexts();
+ assertEquals(1, contextsNoDependencies.size());
+ KernelControllerContext childNoDependencies = contextsNoDependencies.get(0);
+ assertEquals(ControllerState.INSTALLED, childNoDependencies.getState());
+
+ KernelDeployment childDeploymentWithDependencies = createChildDeployment(CHILD + 1, CHILD, PARENT, APP_SCOPE_1, null);
+ deploy(childDeploymentWithDependencies);
+ try
+ {
+ List<KernelControllerContext> contextsWithDependencies = childDeploymentWithDependencies.getInstalledContexts();
+ assertEquals(1, contextsWithDependencies.size());
+ KernelControllerContext childWithDependencies = contextsWithDependencies.get(0);
+ assertFalse(ControllerState.INSTALLED.equals(childWithDependencies.getState()));
+ assertNotSame(childNoDependencies.getController(), childWithDependencies.getController());
+
+ KernelDeployment parentDeployment = createParentDeployment();
+ deploy(parentDeployment);
+ try
+ {
+ ControllerContext parent = getControllerContext(PARENT);
+ ControllerContext child = getControllerContext(CHILD);
+ assertNotSame(parent.getController(), child.getController());
+ assertNotSame(parent.getController(), childNoDependencies.getController());
+ assertNotSame(parent.getController(), childWithDependencies.getController());
+ assertEquals(ControllerState.INSTALLED, childNoDependencies.getState());
+ }
+ finally
+ {
+ undeploy(parentDeployment);
+ }
+ assertNoSuchContext(PARENT);
+ assertFalse(ControllerState.INSTALLED.equals(childWithDependencies.getState()));
+ // unwinded due to the same name
+ assertFalse(ControllerState.INSTALLED.equals(childNoDependencies.getState()));
+ }
+ finally
+ {
+ undeploy(childDeploymentWithDependencies);
+ }
+ }
+ finally
+ {
+ undeploy(childDeploymentNoDependencies);
+ }
+ }
+
+ public void testScopedChildWithNoDependencyAndGlobalChildWithDependencyOnParentViaAliases() throws Throwable
+ {
+ KernelDeployment childDeploymentNoDependencies = createChildDeployment(CHILD + 1, null, APP_SCOPE_2, CHILD);
+ deploy(childDeploymentNoDependencies);
+ try
+ {
+ List<KernelControllerContext> contextsNoDependencies = childDeploymentNoDependencies.getInstalledContexts();
+ assertEquals(1, contextsNoDependencies.size());
+ KernelControllerContext childNoDependencies = contextsNoDependencies.get(0);
+ assertEquals(ControllerState.INSTALLED, childNoDependencies.getState());
+
+ KernelDeployment childDeploymentWithDependencies = createChildDeployment(CHILD + 2, CHILD + 2, PARENT, APP_SCOPE_1, CHILD);
+ deploy(childDeploymentWithDependencies);
+ try
+ {
+ List<KernelControllerContext> contextsWithDependencies = childDeploymentWithDependencies.getInstalledContexts();
+ assertEquals(1, contextsWithDependencies.size());
+ KernelControllerContext childWithDependencies = contextsWithDependencies.get(0);
+ assertFalse(ControllerState.INSTALLED.equals(childWithDependencies.getState()));
+ assertNotSame(childNoDependencies.getController(), childWithDependencies.getController());
+
+ KernelDeployment parentDeployment = createParentDeployment();
+ deploy(parentDeployment);
+ try
+ {
+ ControllerContext parent = getControllerContext(PARENT);
+ ControllerContext child = getControllerContext(CHILD);
+ assertNotSame(parent.getController(), child.getController());
+ assertNotSame(parent.getController(), childNoDependencies.getController());
+ assertNotSame(parent.getController(), childWithDependencies.getController());
+ assertEquals(ControllerState.INSTALLED, childNoDependencies.getState());
+ }
+ finally
+ {
+ undeploy(parentDeployment);
+ }
+ assertNoSuchContext(PARENT);
+ assertFalse(ControllerState.INSTALLED.equals(childWithDependencies.getState()));
+ assertEquals(ControllerState.INSTALLED, childNoDependencies.getState());
+ }
+ finally
+ {
+ undeploy(childDeploymentWithDependencies);
+ }
+ }
+ finally
+ {
+ undeploy(childDeploymentNoDependencies);
+ }
+ }
+
+ public void testTwoScopedChildrenOneWithDependencyOnParent() throws Throwable
+ {
+ runTestTwoScopedChildrenWithDependencyOnParent(false);
+ }
+
+ public void testTwoScopedChildrenOneWithDependencyOnParentReverseOrder() throws Throwable
+ {
+ runTestTwoScopedChildrenWithDependencyOnParent(true);
+ }
+
+ private void runTestTwoScopedChildrenWithDependencyOnParent(boolean withDependencyFirst) throws Throwable
+ {
+ //TODO this will not work until Abstract
+ }
+
+ private KernelDeployment createParentDeployment() throws Throwable
+ {
+ return createDeployment(PARENT, PARENT_CLASS, null, null, null);
+ }
+
+ private KernelDeployment createChildDeployment(String beanName, String dependency, String scope, String alias)
+ {
+ return createChildDeployment(beanName, beanName, dependency, scope, alias);
+ }
+
+ private KernelDeployment createChildDeployment(String deploymentName, String beanName, String dependency, String scope, String alias)
+ {
+ return createDeployment(deploymentName, beanName, CHILD_CLASS, dependency, scope, alias);
+ }
+
+ private KernelDeployment createDeployment(String beanName, String clazz, String dependency, String scope, String alias)
+ {
+ return createDeployment(beanName, beanName, clazz, dependency, scope, alias);
+ }
+
+ @SuppressWarnings({"deprecation"})
+ private KernelDeployment createDeployment(String deploymentName, String beanName, String clazz, String dependency, String scope, String alias)
+ {
+ BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(beanName, clazz);
+ if (dependency != null)
+ {
+ ValueMetaData inject = builder.createInject(dependency);
+ builder.addPropertyMetaData("simpleBean", inject);
+ }
+ if (scope != null)
+ {
+ builder.addAnnotation(new ApplicationScopeImpl(scope));
+ }
+ if (alias != null)
+ {
+ builder.addAnnotation(new AliasesImpl(alias));
+ }
+
+ AbstractKernelDeployment deployment = new AbstractKernelDeployment();
+ deployment.setName(deploymentName);
+ List<BeanMetaDataFactory> beans = Collections.singletonList(builder.getBeanMetaDataFactory());
+ deployment.setBeanFactories(beans);
+ return deployment;
+ }
+
+ /**
+ * assertNoControllerContext() never fails for scoped beans whether installed or not, so use this instead
+ */
+ private void assertNoSuchContext(String name)
+ {
+ try
+ {
+ getControllerContext(name);
+ fail(name + " should not be found");
+ }
+ catch (IllegalStateException e)
+ {
+ }
+ }
+}
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/SuperDemandAnnotationTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/test/SuperDemandAnnotationTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/SuperDemandAnnotationTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/SuperDemandAnnotationTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,48 @@
+/*
+* 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.kernel.deployment.test;
+
+import junit.framework.Test;
+import org.jboss.test.kernel.deployment.support.SomeCacheTreeManager;
+
+/**
+ * SuperDemandAnnotationTestCase
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SuperDemandAnnotationTestCase extends AbstractDeploymentTest
+{
+ public SuperDemandAnnotationTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(SuperDemandAnnotationTestCase.class);
+ }
+
+ public void testDependency() throws Throwable
+ {
+ assertBean("Manager", SomeCacheTreeManager.class);
+ }
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/SuperDemandInstallTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/test/SuperDemandInstallTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/SuperDemandInstallTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/SuperDemandInstallTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,48 @@
+/*
+* 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.kernel.deployment.test;
+
+import junit.framework.Test;
+import org.jboss.test.kernel.deployment.support.SomeCacheTreeManager;
+
+/**
+ * SuperDemandAnnotationTestCase
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SuperDemandInstallTestCase extends AbstractDeploymentTest
+{
+ public SuperDemandInstallTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(SuperDemandInstallTestCase.class);
+ }
+
+ public void testDependency() throws Throwable
+ {
+ assertBean("Manager", SomeCacheTreeManager.class);
+ }
+}
\ No newline at end of file
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.java (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/java/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.java)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.java (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/java/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.java 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,54 @@
+/*
+* 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.kernel.deployment.test;
+
+import junit.framework.Test;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.test.kernel.junit.MicrocontainerTest;
+import org.jboss.dependency.spi.ControllerState;
+
+/**
+ * TransitiveBeansTestCase
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class TransitiveBeansTestCase extends MicrocontainerTest
+{
+ public TransitiveBeansTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(TransitiveBeansTestCase.class);
+ }
+
+ public void testTransitiveShutdown() throws Throwable
+ {
+ KernelControllerContext tm = getControllerContext("RealTM");
+ undeploy(tm);
+ // we're not in error, from possible unconfigure exception
+ KernelControllerContext firstBean = getControllerContext("FirstBean", ControllerState.INSTANTIATED);
+ assertNotNull(firstBean);
+ }
+}
\ No newline at end of file
Deleted: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.xml
===================================================================
--- projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.xml 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
- xmlns="urn:jboss:bean-deployer">
-
- <classloader>
- <bean name="ClassLoader" class="org.jboss.test.kernel.controller.support.SimpleScopedClassLoader"/>
- </classloader>
-
- <beanfactory name="Factory" class="org.jboss.test.kernel.controller.support.PrivilegedBean"/>
-
-</deployment>
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.xml (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer">
+
+ <classloader>
+ <bean name="ClassLoader" class="org.jboss.test.kernel.controller.support.SimpleScopedClassLoader"/>
+ </classloader>
+
+ <beanfactory name="Factory" class="org.jboss.test.kernel.controller.support.PrivilegedBean"/>
+
+</deployment>
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.xml (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="SomeRealName" class="org.jboss.test.kernel.deployment.support.MockServiceBinding">
+ <alias>InjecteeFactory</alias>
+ <constructor>
+ <parameter>jboss.remoting:service=JMXConnectorServer,protocol=rmi</parameter>
+ <parameter>${jboss.bind.address}</parameter>
+ <parameter>1090</parameter>
+ </constructor>
+ </bean>
+
+</deployment>
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/GetInstanceTestCase.xml (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/GetInstanceTestCase.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/GetInstanceTestCase.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/GetInstanceTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="GetInstance" class="org.jboss.test.kernel.deployment.support.GetInstanceBean">
+ <constructor factoryMethod="getInstance"/>
+ </bean>
+
+</deployment>
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/MockEjb3DependsTestCase.xml (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/MockEjb3DependsTestCase.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/MockEjb3DependsTestCase.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/MockEjb3DependsTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="jboss.jca:name=DefaultDS,service=DataSourceBinding" class="org.jboss.test.kernel.deployment.support.SimpleBeanImpl"/>
+
+ <bean name="EJB" class="org.jboss.test.kernel.deployment.support.SimpleBeanImpl">
+ <demand>jboss.jca:service=DataSourceBinding,name=DefaultDS</demand>
+ </bean>
+
+</deployment>
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/SuperDemandAnnotationTestCase.xml (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/SuperDemandAnnotationTestCase.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/SuperDemandAnnotationTestCase.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/SuperDemandAnnotationTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="AnnotationHandlerFactory">
+ <constructor factoryClass="org.jboss.kernel.plugins.annotations.BeanAnnotationAdapterFactory" factoryMethod="getInstance" />
+ </bean>
+ <bean name="AnnotationHandler">
+ <constructor factoryMethod="getBeanAnnotationAdapter">
+ <factory bean="AnnotationHandlerFactory"/>
+ </constructor>
+ <incallback method="addAnnotationPlugin" />
+ <uncallback method="removeAnnotationPlugin" />
+ </bean>
+ <bean name="SuperDemandAnnotationPlugin" class="org.jboss.test.kernel.deployment.support.SuperDemandAnnotationPlugin" />
+
+ <bean name="Manager" class="org.jboss.test.kernel.deployment.support.SomeCacheTreeManager">
+ <property name="clusteredCache"><inject bean="HAPartitionCacheHandler" property="cache"/></property>
+ <annotation>@org.jboss.test.kernel.deployment.support.SuperDemand(demand="Partition", whenRequired="Configured", dependentState="Start")</annotation>
+ </bean>
+
+ <bean name="HAPartitionCacheHandler" class="org.jboss.test.kernel.deployment.support.HAPartitionCacheHandler"/>
+
+ <bean name="Partition" class="org.jboss.test.kernel.deployment.support.HAPartition">
+ <property name="handler"><inject bean="HAPartitionCacheHandler"/></property>
+ </bean>
+
+</deployment>
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/SuperDemandInstallTestCase.xml (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/SuperDemandInstallTestCase.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/SuperDemandInstallTestCase.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/SuperDemandInstallTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="SuperDemand" class="org.jboss.test.kernel.deployment.support.SuperDemandCreator"/>
+
+ <bean name="Manager" class="org.jboss.test.kernel.deployment.support.SomeCacheTreeManager">
+ <property name="clusteredCache"><inject bean="HAPartitionCacheHandler" property="cache"/></property>
+ <install bean="SuperDemand" method="createDependency" whenRequired="Instantiated">
+ <parameter><inject fromContext="name"/></parameter>
+ <parameter>Partition</parameter>
+ <parameter>Configured</parameter>
+ <parameter>Start</parameter>
+ </install>
+ </bean>
+
+ <bean name="HAPartitionCacheHandler" class="org.jboss.test.kernel.deployment.support.HAPartitionCacheHandler"/>
+
+ <bean name="Partition" class="org.jboss.test.kernel.deployment.support.HAPartition">
+ <property name="handler"><inject bean="HAPartitionCacheHandler"/></property>
+ </bean>
+
+</deployment>
Copied: projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.xml (from rev 83467, projects/microcontainer/branches/Branch_2_0/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="RealTM" class="org.jboss.test.kernel.deployment.support.RealTM"/>
+
+ <bean name="FirstBean" class="org.jboss.test.kernel.deployment.support.FirstBean">
+ <property name="tm"><inject bean="RealTM"/></property>
+ </bean>
+
+ <bean name="SecondBean" class="org.jboss.test.kernel.deployment.support.SecondBean">
+ <property name="firstBean"><inject bean="FirstBean"/></property>
+ </bean>
+
+</deployment>
Deleted: projects/microcontainer/tags/2.0.3.GA/pom.xml
===================================================================
--- projects/microcontainer/branches/Branch_2_0/pom.xml 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,358 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-parent</artifactId>
- <version>4</version>
- </parent>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-microcontainer</artifactId>
- <version>2.0.3-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>JBoss Microcontainer Parent POM</name>
- <url>http://www.jboss.org/jbossmc/</url>
- <description>
- The JBoss Microcontainer provides a lightweight container for managing POJOs, their deployment
- and configuration.
- </description>
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/microcontainer/branches/Branch_2_0/</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/microcontainer/branches/Branch_2_0/</developerConnection>
- <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/microcontainer/branches/Branch_2_0/</url>
- </scm>
-
- <modules>
- <module>dependency</module>
- <module>kernel</module>
- <module>aop-mc-int</module>
- <module>spring-int</module>
- <module>guice-int</module>
- <module>build</module>
- </modules>
-
- <properties>
- <version.jboss.common.core>2.2.9.GA</version.jboss.common.core>
- <version.jboss.logging.spi>2.0.5.GA</version.jboss.logging.spi>
- <version.jboss.logging.log4j>2.0.5.GA</version.jboss.logging.log4j>
- <version.jbossxb>2.0.0.GA</version.jbossxb>
- <version.jboss.man>2.0.0.GA</version.jboss.man>
- <version.jboss.vfs>2.0.0.GA</version.jboss.vfs>
- <version.javassist>3.9.0.GA</version.javassist>
- <version.jboss.aop>2.0.0.SP1</version.jboss.aop>
- <version.org.jboss.reflect>2.0.2.GA</version.org.jboss.reflect>
- <version.org.jboss.mdr>2.0.1.GA</version.org.jboss.mdr>
- <version.org.jboss.test>1.1.1.GA</version.org.jboss.test>
- <version.junit>4.4</version.junit>
- <version.jboss.profiler.jvmti>1.0.0.CR5</version.jboss.profiler.jvmti>
- <version.ant.junit>1.6.5</version.ant.junit>
- <version.jboss.drools>4.0.1</version.jboss.drools>
- <version.jboss.jbpm>3.1.1</version.jboss.jbpm>
- <version.google.guice>1.0</version.google.guice>
- </properties>
-
- <build>
- <outputDirectory>${microcontainer.outputDirectory}</outputDirectory>
- <testOutputDirectory>${microcontainer.testOutputDirectory}</testOutputDirectory>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-alpha-3</version>
- <executions>
- <execution>
- <id>enforce-versions</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <phase>validate</phase>
- <configuration>
- <rules>
- <requireMavenVersion>
- <version>2.0.9</version>
- </requireMavenVersion>
- <requireJavaVersion>
- <version>1.5.0</version>
- </requireJavaVersion>
- </rules>
- </configuration>
- </execution>
- </executions>
- <inherited>true</inherited>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.0-beta-7</version>
- <configuration>
- <generateReleasePoms>false</generateReleasePoms>
- <tagBase>https://svn.jboss.org/repos/jbossas/projects/microcontainer/tags</tagBase>
- <autoVersionSubmodules>true</autoVersionSubmodules>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <showDeprecation>true</showDeprecation>
- <showWarnings>true</showWarnings>
- <optimize>true</optimize>
- </configuration>
- </plugin>
- </plugins>
-
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-idea-plugin</artifactId>
- <version>2.2</version>
- <configuration>
- <downloadSources>true</downloadSources>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
- <includes>
- <include>org/jboss/test/**/*TestCase.java</include>
- </includes>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <layout>default</layout>
- <url>http://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshots Repository</name>
- <layout>default</layout>
- <url>http://snapshots.jboss.org/maven2/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </repository>
- </repositories>
-
- <dependencyManagement>
- <!-- The parent pom manages the inter-dependencies of the modules. -->
- <dependencies>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-aop-mc-int</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-managed</artifactId>
- <version>${version.jboss.man}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-metatype</artifactId>
- <version>${version.jboss.man}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-spring-int</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-guice-int</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>${version.jboss.common.core}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <version>${version.jboss.logging.spi}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- <version>${version.jboss.logging.log4j}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- <version>${version.jbossxb}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-reflect</artifactId>
- <version>${version.org.jboss.reflect}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-mdr</artifactId>
- <version>${version.org.jboss.mdr}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <version>${version.jboss.vfs}</version>
- <!-- FIXME http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077827#4077827 -->
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>${version.javassist}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <version>${version.jboss.aop}</version>
- </dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-junit</artifactId>
- <version>${version.ant.junit}</version>
- </dependency>
- <!-- test dependencies -->
- <dependency>
- <groupId>org.jboss.test</groupId>
- <artifactId>jboss-test</artifactId>
- <version>${version.org.jboss.test}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${version.junit}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss.profiler.jvmti</groupId>
- <artifactId>jboss-profiler-jvmti</artifactId>
- <version>${version.jboss.profiler.jvmti}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.guice</groupId>
- <artifactId>guice</artifactId>
- <version>${version.google.guice}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.1</version>
- <reportSets>
- <reportSet>
- <reports>
- <report>dependencies</report>
- <report>issue-tracking</report>
- <report>license</report>
- <report>scm</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <version>1.0.0</version>
- </plugin>
- </plugins>
- </reporting>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <properties>
- <microcontainer.outputDirectory>target/classes</microcontainer.outputDirectory>
- <microcontainer.testOutputDirectory>target/test-classes</microcontainer.testOutputDirectory>
- </properties>
- </profile>
- <profile>
- <id>eclipse</id>
- <build>
- <defaultGoal>process-test-resources</defaultGoal>
- <plugins>
- <plugin>
- <artifactId>maven-eclipse-plugin</artifactId>
- <executions>
- <execution>
- <id>eclipse</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>eclipse</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <downloadSources>true</downloadSources>
- <buildOutputDirectory>${microcontainer.outputDirectory}</buildOutputDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <properties>
- <microcontainer.outputDirectory>eclipse-target/classes</microcontainer.outputDirectory>
- <microcontainer.testOutputDirectory>eclipse-target/tests-classes</microcontainer.testOutputDirectory>
- </properties>
- </profile>
-
- <profile>
- <id>assembly</id>
- <modules>
- <module>docs</module>
- </modules>
- </profile>
- </profiles>
-
-</project>
Copied: projects/microcontainer/tags/2.0.3.GA/pom.xml (from rev 83478, projects/microcontainer/branches/Branch_2_0/pom.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/pom.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,358 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-parent</artifactId>
+ <version>4</version>
+ </parent>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-microcontainer</artifactId>
+ <version>2.0.3.GA</version>
+ <packaging>pom</packaging>
+ <name>JBoss Microcontainer Parent POM</name>
+ <url>http://www.jboss.org/jbossmc/</url>
+ <description>
+ The JBoss Microcontainer provides a lightweight container for managing POJOs, their deployment
+ and configuration.
+ </description>
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/microcontainer/tags/2.0.3.GA</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/microcontainer/tags/2.0.3.GA</developerConnection>
+ <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/microcontainer/tags/2.0.3.GA</url>
+ </scm>
+
+ <modules>
+ <module>dependency</module>
+ <module>kernel</module>
+ <module>aop-mc-int</module>
+ <module>spring-int</module>
+ <module>guice-int</module>
+ <module>build</module>
+ </modules>
+
+ <properties>
+ <version.jboss.common.core>2.2.10.GA</version.jboss.common.core>
+ <version.jboss.logging.spi>2.0.5.GA</version.jboss.logging.spi>
+ <version.jboss.logging.log4j>2.0.5.GA</version.jboss.logging.log4j>
+ <version.jbossxb>2.0.0.GA</version.jbossxb>
+ <version.jboss.man>2.0.0.GA</version.jboss.man>
+ <version.jboss.vfs>2.0.1.GA</version.jboss.vfs>
+ <version.javassist>3.9.0.GA</version.javassist>
+ <version.jboss.aop>2.0.0.SP1</version.jboss.aop>
+ <version.org.jboss.reflect>2.0.2.GA</version.org.jboss.reflect>
+ <version.org.jboss.mdr>2.0.1.GA</version.org.jboss.mdr>
+ <version.org.jboss.test>1.1.1.GA</version.org.jboss.test>
+ <version.junit>4.4</version.junit>
+ <version.jboss.profiler.jvmti>1.0.0.CR5</version.jboss.profiler.jvmti>
+ <version.ant.junit>1.6.5</version.ant.junit>
+ <version.jboss.drools>4.0.1</version.jboss.drools>
+ <version.jboss.jbpm>3.1.1</version.jboss.jbpm>
+ <version.google.guice>1.0</version.google.guice>
+ </properties>
+
+ <build>
+ <outputDirectory>${microcontainer.outputDirectory}</outputDirectory>
+ <testOutputDirectory>${microcontainer.testOutputDirectory}</testOutputDirectory>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-alpha-3</version>
+ <executions>
+ <execution>
+ <id>enforce-versions</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <phase>validate</phase>
+ <configuration>
+ <rules>
+ <requireMavenVersion>
+ <version>2.0.9</version>
+ </requireMavenVersion>
+ <requireJavaVersion>
+ <version>1.5.0</version>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ <inherited>true</inherited>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.0-beta-7</version>
+ <configuration>
+ <generateReleasePoms>false</generateReleasePoms>
+ <tagBase>https://svn.jboss.org/repos/jbossas/projects/microcontainer/tags</tagBase>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <optimize>true</optimize>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-idea-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <includes>
+ <include>org/jboss/test/**/*TestCase.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <layout>default</layout>
+ <url>http://snapshots.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+ <dependencyManagement>
+ <!-- The parent pom manages the inter-dependencies of the modules. -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-aop-mc-int</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ <version>${version.jboss.man}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-metatype</artifactId>
+ <version>${version.jboss.man}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-spring-int</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-guice-int</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>${version.jboss.common.core}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <version>${version.jboss.logging.spi}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <version>${version.jboss.logging.log4j}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ <version>${version.jbossxb}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ <version>${version.org.jboss.reflect}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ <version>${version.org.jboss.mdr}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <version>${version.jboss.vfs}</version>
+ <!-- FIXME http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077827#4077827 -->
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>${version.javassist}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <version>${version.jboss.aop}</version>
+ </dependency>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ <version>${version.ant.junit}</version>
+ </dependency>
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.jboss.test</groupId>
+ <artifactId>jboss-test</artifactId>
+ <version>${version.org.jboss.test}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss.profiler.jvmti</groupId>
+ <artifactId>jboss-profiler-jvmti</artifactId>
+ <version>${version.jboss.profiler.jvmti}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.guice</groupId>
+ <artifactId>guice</artifactId>
+ <version>${version.google.guice}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.1</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>dependencies</report>
+ <report>issue-tracking</report>
+ <report>license</report>
+ <report>scm</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>1.0.0</version>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <microcontainer.outputDirectory>target/classes</microcontainer.outputDirectory>
+ <microcontainer.testOutputDirectory>target/test-classes</microcontainer.testOutputDirectory>
+ </properties>
+ </profile>
+ <profile>
+ <id>eclipse</id>
+ <build>
+ <defaultGoal>process-test-resources</defaultGoal>
+ <plugins>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>eclipse</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>eclipse</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ <buildOutputDirectory>${microcontainer.outputDirectory}</buildOutputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <microcontainer.outputDirectory>eclipse-target/classes</microcontainer.outputDirectory>
+ <microcontainer.testOutputDirectory>eclipse-target/tests-classes</microcontainer.testOutputDirectory>
+ </properties>
+ </profile>
+
+ <profile>
+ <id>assembly</id>
+ <modules>
+ <module>docs</module>
+ </modules>
+ </profile>
+ </profiles>
+
+</project>
Deleted: projects/microcontainer/tags/2.0.3.GA/spring-int/pom.xml
===================================================================
--- projects/microcontainer/branches/Branch_2_0/spring-int/pom.xml 2009-01-27 10:48:03 UTC (rev 83459)
+++ projects/microcontainer/tags/2.0.3.GA/spring-int/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -1,43 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-microcontainer</artifactId>
- <version>2.0.3-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-spring-int</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Microcontainer Spring Int</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Microcontainer Spring Integration</description>
-
- <!-- Do not add version information here, use ../pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-managed</artifactId>
- <optional>true</optional>
- </dependency>
- <!-- Test dependencies -->
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test</groupId>
- <artifactId>jboss-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
Copied: projects/microcontainer/tags/2.0.3.GA/spring-int/pom.xml (from rev 83478, projects/microcontainer/branches/Branch_2_0/spring-int/pom.xml)
===================================================================
--- projects/microcontainer/tags/2.0.3.GA/spring-int/pom.xml (rev 0)
+++ projects/microcontainer/tags/2.0.3.GA/spring-int/pom.xml 2009-01-27 13:04:51 UTC (rev 83479)
@@ -0,0 +1,43 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-microcontainer</artifactId>
+ <version>2.0.3.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-spring-int</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Microcontainer Spring Int</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Microcontainer Spring Integration</description>
+
+ <!-- Do not add version information here, use ../pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test</groupId>
+ <artifactId>jboss-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
More information about the jboss-cvs-commits
mailing list