[jboss-cvs] JBossAS SVN: r83490 - in projects/jboss-deployers/tags: 2.0.4.GA and 37 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jan 27 08:42:59 EST 2009
Author: alesj
Date: 2009-01-27 08:42:58 -0500 (Tue, 27 Jan 2009)
New Revision: 83490
Added:
projects/jboss-deployers/tags/2.0.4.GA/
projects/jboss-deployers/tags/2.0.4.GA/build/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-client-spi/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-client/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-core-spi/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-core/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/StructureProcessor.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/AbstractModificationTypeMatcher.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/FileModificationTypeMatcher.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeMatcher.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeStructureProcessor.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/TempTopModificationTypeMatcher.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/resources/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.class
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/resources/structureprocessor/
projects/jboss-deployers/tags/2.0.4.GA/pom.xml
Removed:
projects/jboss-deployers/tags/2.0.4.GA/build/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-client-spi/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-client/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-core-spi/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-core/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/pom.xml
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java
projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/resources/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.class
projects/jboss-deployers/tags/2.0.4.GA/pom.xml
Log:
[maven-release-plugin] copy for tag 2.0.4.GA
Copied: projects/jboss-deployers/tags/2.0.4.GA (from rev 83462, projects/jboss-deployers/branches/Branch_2_0)
Deleted: projects/jboss-deployers/tags/2.0.4.GA/build/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/build/pom.xml 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/build/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,83 +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.deployers</groupId>
- <artifactId>jboss-deployers</artifactId>
- <version>2.0.4-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-dist</artifactId>
- <packaging>pom</packaging>
- <name>JBoss Deployers Distribution Build</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>
- The JBoss Deployment Distribution Build.
- </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-deployers-${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.deployers</groupId>
- <artifactId>jboss-deployers-client</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-structure-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- </dependency>
- </dependencies>
-
-</project>
\ No newline at end of file
Copied: projects/jboss-deployers/tags/2.0.4.GA/build/pom.xml (from rev 83489, projects/jboss-deployers/branches/Branch_2_0/build/pom.xml)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/build/pom.xml (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/build/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,83 @@
+<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.deployers</groupId>
+ <artifactId>jboss-deployers</artifactId>
+ <version>2.0.4.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-dist</artifactId>
+ <packaging>pom</packaging>
+ <name>JBoss Deployers Distribution Build</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>
+ The JBoss Deployment Distribution Build.
+ </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-deployers-${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.deployers</groupId>
+ <artifactId>jboss-deployers-client</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-structure-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-client/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-client/pom.xml 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-client/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,65 +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.deployers</groupId>
- <artifactId>jboss-deployers</artifactId>
- <version>2.0.4-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-deployers-client</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Deployers Client</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Deployers Client</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>
- </plugins>
- </build>
-
- <!-- Do not add version information here, use ../pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- </dependency>
- <!-- Test dependencies -->
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <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/jboss-deployers/tags/2.0.4.GA/deployers-client/pom.xml (from rev 83489, projects/jboss-deployers/branches/Branch_2_0/deployers-client/pom.xml)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-client/pom.xml (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-client/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,65 @@
+<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.deployers</groupId>
+ <artifactId>jboss-deployers</artifactId>
+ <version>2.0.4.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-deployers-client</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Deployers Client</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Deployers Client</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>
+ </plugins>
+ </build>
+
+ <!-- Do not add version information here, use ../pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <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/jboss-deployers/tags/2.0.4.GA/deployers-client-spi/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-client-spi/pom.xml 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-client-spi/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,40 +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.deployers</groupId>
- <artifactId>jboss-deployers</artifactId>
- <version>2.0.4-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-deployers-client-spi</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Deployers Client SPI</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Deployers Client SPI</description>
-
- <!-- Do not add version information here, use ../pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.man</groupId>
- <artifactId>jboss-managed</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-reflect</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>
- </exclusions>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-client-spi/pom.xml (from rev 83489, projects/jboss-deployers/branches/Branch_2_0/deployers-client-spi/pom.xml)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-client-spi/pom.xml (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-client-spi/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,40 @@
+<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.deployers</groupId>
+ <artifactId>jboss-deployers</artifactId>
+ <version>2.0.4.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Deployers Client SPI</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Deployers Client SPI</description>
+
+ <!-- Do not add version information here, use ../pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</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>
+ </exclusions>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-core/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-core/pom.xml 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-core/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,60 +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.deployers</groupId>
- <artifactId>jboss-deployers</artifactId>
- <version>2.0.4-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-deployers-core</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Deployers Core</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Deployers Core</description>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <!-- Do not add version information here, use ../build/pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</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/jboss-deployers/tags/2.0.4.GA/deployers-core/pom.xml (from rev 83489, projects/jboss-deployers/branches/Branch_2_0/deployers-core/pom.xml)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-core/pom.xml (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-core/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,60 @@
+<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.deployers</groupId>
+ <artifactId>jboss-deployers</artifactId>
+ <version>2.0.4.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-deployers-core</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Deployers Core</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Deployers Core</description>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <!-- Do not add version information here, use ../build/pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</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/jboss-deployers/tags/2.0.4.GA/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,341 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, 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.deployers.plugins.structure;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.jboss.deployers.spi.attachments.helpers.PredeterminedManagedObjectAttachmentsImpl;
-import org.jboss.deployers.spi.structure.ClassPathEntry;
-import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.spi.structure.ModificationType;
-
-/**
- * ContextInfoImpl.
- *
- * @author <a href="adrian at jboss.org">Adrian Brock</a>
- * @author <a href="ales.justin at jboss.org">Ales Justin</a>
- * @author Scott.Stark at jboss.org
- * @version $Revision: 1.1 $
- */
-public class ContextInfoImpl extends PredeterminedManagedObjectAttachmentsImpl
- implements ContextInfo, Externalizable
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = -4384869824260284607L;
-
- /** The logical path */
- private String path;
-
- /** The metadata path */
- private List<String> metaDataPath;
-
- /** The class path entries */
- private List<ClassPathEntry> classPath = ClassPathEntryImpl.DEFAULT;
-
- private int relativeOrder = 0;
-
- /** The comparator class name */
- private String comparatorClassName;
-
- /** The modification type */
- private ModificationType modificationType;
-
- /**
- * Create a new ContextInfoImpl.
- */
- public ContextInfoImpl()
- {
- setPath("");
- }
-
- /**
- * Create a new ContextInfoImpl.
- *
- * @param path the path
- * @throws IllegalArgumentException for a null path
- */
- public ContextInfoImpl(String path)
- {
- setPath(path);
- }
-
- /**
- * Create a new ContextInfoImpl.
- *
- * @param path the path
- * @param classPath the classpath
- * @throws IllegalArgumentException for a null path
- */
- public ContextInfoImpl(String path, List<ClassPathEntry> classPath)
- {
- setPath(path);
- setClassPath(classPath);
- }
-
- /**
- * Create a new ContextInfoImpl.
- *
- * @param path the path
- * @param metaDataPath a single metadata path
- * @param classPath the class path
- * @throws IllegalArgumentException for a null path or metadata path
- */
- public ContextInfoImpl(String path, String metaDataPath, List<ClassPathEntry> classPath)
- {
- setPath(path);
- if (metaDataPath == null)
- throw new IllegalArgumentException("Null metadata path.");
- setMetaDataPath(Collections.singletonList(metaDataPath));
- setClassPath(classPath);
- }
-
- /**
- * Create a new ContextInfoImpl.
- *
- * @param path the path
- * @param metaDataPath the metadata paths
- * @param classPath the class path
- * @throws IllegalArgumentException for a null path or metadata path
- */
- public ContextInfoImpl(String path, List<String> metaDataPath, List<ClassPathEntry> classPath)
- {
- setPath(path);
- setMetaDataPath(metaDataPath);
- setClassPath(classPath);
- }
-
- public String getPath()
- {
- return path;
- }
-
- /**
- * Set the path.
- *
- * @param path the path.
- * @throws IllegalArgumentException for a null path
- */
- public void setPath(String path)
- {
- if (path == null)
- throw new IllegalArgumentException("Null path");
- this.path = path;
- }
-
- public List<String> getMetaDataPath()
- {
- if (metaDataPath == null)
- return Collections.emptyList();
- return metaDataPath;
- }
-
- /**
- * Set the meta data paths.
- *
- * @param metaDataPath the meta data paths
- */
- public void setMetaDataPath(List<String> metaDataPath)
- {
- this.metaDataPath = metaDataPath;
- }
-
- public void addMetaDataPath(String path)
- {
- if (path == null)
- throw new IllegalArgumentException("Null path");
-
- if (metaDataPath == null)
- metaDataPath = Collections.singletonList(path);
- else if (metaDataPath.size() == 1)
- {
- List<String> paths = new ArrayList<String>();
- paths.addAll(metaDataPath);
- paths.add(path);
- metaDataPath = paths;
- }
- else
- metaDataPath.add(path);
- }
-
- public List<ClassPathEntry> getClassPath()
- {
- return classPath;
- }
-
- /**
- * Set the classPath.
- *
- * @param classPath the classPath.
- */
- public void setClassPath(List<ClassPathEntry> classPath)
- {
- this.classPath = classPath;
- }
-
- public void addClassPathEntry(ClassPathEntry entry)
- {
- if (entry == null)
- throw new IllegalArgumentException("Null entry");
-
- if (classPath == null || classPath == ClassPathEntryImpl.DEFAULT)
- {
- List<ClassPathEntry> old = classPath;
- classPath = new ArrayList<ClassPathEntry>();
- if (old != null)
- classPath.addAll(old);
- }
- classPath.add(entry);
- }
-
- public String getComparatorClassName()
- {
- return comparatorClassName;
- }
-
- public void setComparatorClassName(String className)
- {
- this.comparatorClassName = className;
- }
-
- public int getRelativeOrder()
- {
- return relativeOrder;
- }
-
- public void setRelativeOrder(int relativeOrder)
- {
- this.relativeOrder = relativeOrder;
- }
-
- public ModificationType getModificationType()
- {
- return modificationType;
- }
-
- public void setModificationType(ModificationType modificationType)
- {
- this.modificationType = modificationType;
- }
-
- @Override
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append(getClass().getSimpleName());
- builder.append("{");
- toString(builder);
- builder.append("}");
- return builder.toString();
- }
-
- /**
- * For subclasses to override toString()
- *
- * @param builder the builder
- */
- protected void toString(StringBuilder builder)
- {
- builder.append("path=").append(getPath());
- builder.append(" metaData=").append(getMetaDataPath());
- builder.append(" classPath=").append(getClassPath());
- if (relativeOrder != 0)
- builder.append(" relativeOrder=").append(getRelativeOrder());
- if (comparatorClassName != null)
- builder.append(" comparator=").append(getComparatorClassName());
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj == this)
- return true;
- if (obj == null || obj instanceof ContextInfo == false)
- return false;
-
- ContextInfo other = (ContextInfo) obj;
- if (getPath().equals(other.getPath()) == false)
- return false;
-
- List<String> thisMetaDataPath = getMetaDataPath();
- List<String> otherMetaDataPath = other.getMetaDataPath();
- if (thisMetaDataPath.equals(otherMetaDataPath) == false)
- return false;
-
- List<ClassPathEntry> thisClassPath = getClassPath();
- List<ClassPathEntry> otherClassPath = other.getClassPath();
- if (thisClassPath == null)
- return otherClassPath == null;
- return thisClassPath.equals(otherClassPath);
- }
-
- @Override
- public int hashCode()
- {
- return getPath().hashCode();
- }
-
- @SuppressWarnings("unchecked")
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- {
- super.readExternal(in);
- setPath(in.readUTF());
- boolean isEmptyMetaDataPath = in.readBoolean();
- if (isEmptyMetaDataPath == false)
- setMetaDataPath((List<String>)in.readObject());
- setClassPath((List) in.readObject());
- setRelativeOrder(in.readInt());
- boolean isNullComparator = in.readBoolean();
- if (isNullComparator == false)
- setComparatorClassName(in.readUTF());
- }
-
- /**
- * @serialData path from {@link #getPath()}
- * @serialData metaDataPath from {@link #getMetaDataPath()}
- * @serialData classPath from {@link #getClassPath()}
- * @param out the output
- * @throws IOException for any error
- */
- public void writeExternal(ObjectOutput out) throws IOException
- {
- super.writeExternal(out);
- out.writeUTF(getPath());
- List<String> metaDataPath = getMetaDataPath();
- boolean isEmptyMetaDataPath = metaDataPath.isEmpty();
- out.writeBoolean(isEmptyMetaDataPath);
- if (isEmptyMetaDataPath == false)
- out.writeObject(metaDataPath);
- out.writeObject(getClassPath());
- out.writeInt(getRelativeOrder());
- String comparator = getComparatorClassName();
- boolean isNullComparator = (comparator == null);
- out.writeBoolean(isNullComparator);
- if (isNullComparator == false)
- out.writeUTF(comparator);
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,343 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.deployers.plugins.structure;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.deployers.spi.attachments.helpers.PredeterminedManagedObjectAttachmentsImpl;
+import org.jboss.deployers.spi.structure.ClassPathEntry;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.ModificationType;
+
+/**
+ * ContextInfoImpl.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 1.1 $
+ */
+public class ContextInfoImpl extends PredeterminedManagedObjectAttachmentsImpl
+ implements ContextInfo, Externalizable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -4384869824260284607L;
+
+ /** The logical path */
+ private String path;
+
+ /** The metadata path */
+ private List<String> metaDataPath;
+
+ /** The class path entries */
+ private List<ClassPathEntry> classPath = ClassPathEntryImpl.DEFAULT;
+
+ private int relativeOrder = 0;
+
+ /** The comparator class name */
+ private String comparatorClassName;
+
+ /** The modification type */
+ private ModificationType modificationType;
+
+ /**
+ * Create a new ContextInfoImpl.
+ */
+ public ContextInfoImpl()
+ {
+ setPath("");
+ }
+
+ /**
+ * Create a new ContextInfoImpl.
+ *
+ * @param path the path
+ * @throws IllegalArgumentException for a null path
+ */
+ public ContextInfoImpl(String path)
+ {
+ setPath(path);
+ }
+
+ /**
+ * Create a new ContextInfoImpl.
+ *
+ * @param path the path
+ * @param classPath the classpath
+ * @throws IllegalArgumentException for a null path
+ */
+ public ContextInfoImpl(String path, List<ClassPathEntry> classPath)
+ {
+ setPath(path);
+ setClassPath(classPath);
+ }
+
+ /**
+ * Create a new ContextInfoImpl.
+ *
+ * @param path the path
+ * @param metaDataPath a single metadata path
+ * @param classPath the class path
+ * @throws IllegalArgumentException for a null path or metadata path
+ */
+ public ContextInfoImpl(String path, String metaDataPath, List<ClassPathEntry> classPath)
+ {
+ setPath(path);
+ if (metaDataPath == null)
+ throw new IllegalArgumentException("Null metadata path.");
+ setMetaDataPath(Collections.singletonList(metaDataPath));
+ setClassPath(classPath);
+ }
+
+ /**
+ * Create a new ContextInfoImpl.
+ *
+ * @param path the path
+ * @param metaDataPath the metadata paths
+ * @param classPath the class path
+ * @throws IllegalArgumentException for a null path or metadata path
+ */
+ public ContextInfoImpl(String path, List<String> metaDataPath, List<ClassPathEntry> classPath)
+ {
+ setPath(path);
+ setMetaDataPath(metaDataPath);
+ setClassPath(classPath);
+ }
+
+ public String getPath()
+ {
+ return path;
+ }
+
+ /**
+ * Set the path.
+ *
+ * @param path the path.
+ * @throws IllegalArgumentException for a null path
+ */
+ public void setPath(String path)
+ {
+ if (path == null)
+ throw new IllegalArgumentException("Null path");
+ this.path = path;
+ }
+
+ public List<String> getMetaDataPath()
+ {
+ if (metaDataPath == null)
+ return Collections.emptyList();
+ return metaDataPath;
+ }
+
+ /**
+ * Set the meta data paths.
+ *
+ * @param metaDataPath the meta data paths
+ */
+ public void setMetaDataPath(List<String> metaDataPath)
+ {
+ this.metaDataPath = metaDataPath;
+ }
+
+ public void addMetaDataPath(String path)
+ {
+ if (path == null)
+ throw new IllegalArgumentException("Null path");
+
+ if (metaDataPath == null)
+ metaDataPath = Collections.singletonList(path);
+ else if (metaDataPath.size() == 1)
+ {
+ List<String> paths = new ArrayList<String>();
+ paths.addAll(metaDataPath);
+ paths.add(path);
+ metaDataPath = paths;
+ }
+ else
+ metaDataPath.add(path);
+ }
+
+ public List<ClassPathEntry> getClassPath()
+ {
+ return classPath;
+ }
+
+ /**
+ * Set the classPath.
+ *
+ * @param classPath the classPath.
+ */
+ public void setClassPath(List<ClassPathEntry> classPath)
+ {
+ this.classPath = classPath;
+ }
+
+ public void addClassPathEntry(ClassPathEntry entry)
+ {
+ if (entry == null)
+ throw new IllegalArgumentException("Null entry");
+
+ if (classPath == null || classPath == ClassPathEntryImpl.DEFAULT)
+ {
+ List<ClassPathEntry> old = classPath;
+ classPath = new ArrayList<ClassPathEntry>();
+ if (old != null)
+ classPath.addAll(old);
+ }
+ classPath.add(entry);
+ }
+
+ public String getComparatorClassName()
+ {
+ return comparatorClassName;
+ }
+
+ public void setComparatorClassName(String className)
+ {
+ this.comparatorClassName = className;
+ }
+
+ public int getRelativeOrder()
+ {
+ return relativeOrder;
+ }
+
+ public void setRelativeOrder(int relativeOrder)
+ {
+ this.relativeOrder = relativeOrder;
+ }
+
+ public ModificationType getModificationType()
+ {
+ return modificationType;
+ }
+
+ public void setModificationType(ModificationType modificationType)
+ {
+ this.modificationType = modificationType;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append(getClass().getSimpleName());
+ builder.append("{");
+ toString(builder);
+ builder.append("}");
+ return builder.toString();
+ }
+
+ /**
+ * For subclasses to override toString()
+ *
+ * @param builder the builder
+ */
+ protected void toString(StringBuilder builder)
+ {
+ builder.append("path=").append(getPath());
+ builder.append(" metaData=").append(getMetaDataPath());
+ builder.append(" classPath=").append(getClassPath());
+ if (relativeOrder != 0)
+ builder.append(" relativeOrder=").append(getRelativeOrder());
+ if (comparatorClassName != null)
+ builder.append(" comparator=").append(getComparatorClassName());
+ if (modificationType != null)
+ builder.append(" modification=").append(modificationType);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ return true;
+ if (obj == null || obj instanceof ContextInfo == false)
+ return false;
+
+ ContextInfo other = (ContextInfo) obj;
+ if (getPath().equals(other.getPath()) == false)
+ return false;
+
+ List<String> thisMetaDataPath = getMetaDataPath();
+ List<String> otherMetaDataPath = other.getMetaDataPath();
+ if (thisMetaDataPath.equals(otherMetaDataPath) == false)
+ return false;
+
+ List<ClassPathEntry> thisClassPath = getClassPath();
+ List<ClassPathEntry> otherClassPath = other.getClassPath();
+ if (thisClassPath == null)
+ return otherClassPath == null;
+ return thisClassPath.equals(otherClassPath);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getPath().hashCode();
+ }
+
+ @SuppressWarnings("unchecked")
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ super.readExternal(in);
+ setPath(in.readUTF());
+ boolean isEmptyMetaDataPath = in.readBoolean();
+ if (isEmptyMetaDataPath == false)
+ setMetaDataPath((List<String>)in.readObject());
+ setClassPath((List) in.readObject());
+ setRelativeOrder(in.readInt());
+ boolean isNullComparator = in.readBoolean();
+ if (isNullComparator == false)
+ setComparatorClassName(in.readUTF());
+ }
+
+ /**
+ * @serialData path from {@link #getPath()}
+ * @serialData metaDataPath from {@link #getMetaDataPath()}
+ * @serialData classPath from {@link #getClassPath()}
+ * @param out the output
+ * @throws IOException for any error
+ */
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ super.writeExternal(out);
+ out.writeUTF(getPath());
+ List<String> metaDataPath = getMetaDataPath();
+ boolean isEmptyMetaDataPath = metaDataPath.isEmpty();
+ out.writeBoolean(isEmptyMetaDataPath);
+ if (isEmptyMetaDataPath == false)
+ out.writeObject(metaDataPath);
+ out.writeObject(getClassPath());
+ out.writeInt(getRelativeOrder());
+ String comparator = getComparatorClassName();
+ boolean isNullComparator = (comparator == null);
+ out.writeBoolean(isNullComparator);
+ if (isNullComparator == false)
+ out.writeUTF(comparator);
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-core-spi/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-core-spi/pom.xml 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-core-spi/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,40 +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.deployers</groupId>
- <artifactId>jboss-deployers</artifactId>
- <version>2.0.4-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-deployers-core-spi</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Deployers Core SPI</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Deployers Core SPI</description>
-
- <!-- Do not add version information here, use ../pom.xml instead -->
- <!-- Global dependencies -->
- <dependencies>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-slide</groupId>
- <artifactId>webdavlib</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-xerces</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-core-spi/pom.xml (from rev 83489, projects/jboss-deployers/branches/Branch_2_0/deployers-core-spi/pom.xml)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-core-spi/pom.xml (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-core-spi/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,40 @@
+<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.deployers</groupId>
+ <artifactId>jboss-deployers</artifactId>
+ <version>2.0.4.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Deployers Core SPI</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Deployers Core SPI</description>
+
+ <!-- Do not add version information here, use ../pom.xml instead -->
+ <!-- Global dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>apache-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>apache-slide</groupId>
+ <artifactId>webdavlib</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/pom.xml 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,186 +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.deployers</groupId>
- <artifactId>jboss-deployers</artifactId>
- <version>2.0.4-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-deployers-impl</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Deployers Impl</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Deployers Impl</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>
- </plugins>
- </build>
-
- <!-- Do not add version information here, use ../pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-spi</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.cl</groupId>
- <artifactId>jboss-classloading</artifactId>
- <exclusions>
- <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.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-mdr</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-reflect</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>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- </dependency>
- <!-- Test dependencies -->
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-container</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>apache-xerces</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <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/jboss-deployers/tags/2.0.4.GA/deployers-impl/pom.xml (from rev 83489, projects/jboss-deployers/branches/Branch_2_0/deployers-impl/pom.xml)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/pom.xml (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,186 @@
+<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.deployers</groupId>
+ <artifactId>jboss-deployers</artifactId>
+ <version>2.0.4.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-deployers-impl</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Deployers Impl</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Deployers Impl</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>
+ </plugins>
+ </build>
+
+ <!-- Do not add version information here, use ../pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-spi</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cl</groupId>
+ <artifactId>jboss-classloading</artifactId>
+ <exclusions>
+ <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.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</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>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-container</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <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/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,154 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, 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.deployers.plugins.classloading;
-
-import java.util.Set;
-
-import org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule;
-import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.dependency.spi.Controller;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-
-/**
- * AbstractDeploymentClassLoaderPolicyModule.
- *
- * @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 $
- */
-public abstract class AbstractDeploymentClassLoaderPolicyModule extends ClassLoaderPolicyModule
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = 1L;
-
- /** The classloader state for deployments */
- private static ControllerState CLASSLOADER_STATE = new ControllerState(DeploymentStages.CLASSLOADER.getName());
-
- /** The deployment unit */
- private DeploymentUnit unit;
-
- /**
- * Determine the classloading metadata for the deployment unit
- *
- * @param unit the deployment unit
- * @return the classloading metadata
- */
- private static ClassLoadingMetaData determineClassLoadingMetaData(DeploymentUnit unit)
- {
- if (unit == null)
- throw new IllegalArgumentException("Null unit");
- return unit.getAttachment(ClassLoadingMetaData.class);
- }
-
- /**
- * Determine the classloading metadata for the deployment unit
- *
- * @param unit the deployment unit
- * @param addAlias should we add alias or remove
- * @return the classloading metadata
- */
- private static String determineContextName(DeploymentUnit unit, boolean addAlias)
- {
- if (unit == null)
- throw new IllegalArgumentException("Null unit");
-
- ControllerContext context = unit.getTopLevel().getAttachment(ControllerContext.class);
- if (context == null)
- throw new IllegalStateException("Deployment has no controller context");
-
- // We use the deployment name
- String contextName = unit.getName();
-
- // Check to see whether we need to add our name as an alias
- if (contextName.equals(context.getName()) == false)
- {
- Set<Object> aliases = context.getAliases();
- if (aliases == null || (aliases != null && aliases.contains(contextName) == false))
- {
- Controller controller = context.getController();
- if (addAlias)
- {
- try
- {
- controller.addAlias(contextName, context.getName());
- }
- catch (Throwable t)
- {
- throw new RuntimeException("Error adding deployment alias " + contextName + " to " + context, t);
- }
- }
- else
- {
- controller.removeAlias(contextName);
- }
- }
- }
-
- return contextName;
- }
-
- /**
- * Create a new AbstractDeploymentClassLoaderPolicyModule.
- *
- * @param unit the deployment unit
- * @throws IllegalArgumentException for a null unit
- */
- public AbstractDeploymentClassLoaderPolicyModule(DeploymentUnit unit)
- {
- super(determineClassLoadingMetaData(unit), determineContextName(unit, true));
- this.unit = unit;
- ControllerContext context = unit.getTopLevel().getAttachment(ControllerContext.class);
- setControllerContext(context);
- }
-
- /**
- * Get the unit.
- *
- * @return the unit.
- */
- public DeploymentUnit getDeploymentUnit()
- {
- return unit;
- }
-
- @Override
- public ControllerState getClassLoaderState()
- {
- return CLASSLOADER_STATE;
- }
-
- @Override
- public void release()
- {
- try
- {
- super.release();
- }
- finally
- {
- determineContextName(unit, false);
- }
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,154 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, 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.deployers.plugins.classloading;
+
+import java.util.Set;
+
+import org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule;
+import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.Controller;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * AbstractDeploymentClassLoaderPolicyModule.
+ *
+ * @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 $
+ */
+public abstract class AbstractDeploymentClassLoaderPolicyModule extends ClassLoaderPolicyModule
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ /** The classloader state for deployments */
+ private static ControllerState CLASSLOADER_STATE = new ControllerState(DeploymentStages.CLASSLOADER.getName());
+
+ /** The deployment unit */
+ private DeploymentUnit unit;
+
+ /**
+ * Determine the classloading metadata for the deployment unit
+ *
+ * @param unit the deployment unit
+ * @return the classloading metadata
+ */
+ private static ClassLoadingMetaData determineClassLoadingMetaData(DeploymentUnit unit)
+ {
+ if (unit == null)
+ throw new IllegalArgumentException("Null unit");
+ return unit.getAttachment(ClassLoadingMetaData.class);
+ }
+
+ /**
+ * Determine the classloading metadata for the deployment unit
+ *
+ * @param unit the deployment unit
+ * @param addAlias should we add alias or remove
+ * @return the classloading metadata
+ */
+ private static String determineContextName(DeploymentUnit unit, boolean addAlias)
+ {
+ if (unit == null)
+ throw new IllegalArgumentException("Null unit");
+
+ ControllerContext context = unit.getTopLevel().getAttachment(ControllerContext.class);
+ if (context == null)
+ throw new IllegalStateException("Deployment has no controller context");
+
+ // We use the deployment name
+ String contextName = unit.getName();
+
+ // Check to see whether we need to add our name as an alias
+ if (contextName.equals(context.getName()) == false)
+ {
+ Set<Object> aliases = context.getAliases();
+ if (aliases == null || (aliases != null && aliases.contains(contextName) == false))
+ {
+ Controller controller = context.getController();
+ if (addAlias)
+ {
+ try
+ {
+ controller.addAlias(contextName, context.getName());
+ }
+ catch (Throwable t)
+ {
+ throw new RuntimeException("Error adding deployment alias " + contextName + " to " + context, t);
+ }
+ }
+ else
+ {
+ controller.removeAlias(contextName);
+ }
+ }
+ }
+
+ return contextName;
+ }
+
+ /**
+ * Create a new AbstractDeploymentClassLoaderPolicyModule.
+ *
+ * @param unit the deployment unit
+ * @throws IllegalArgumentException for a null unit
+ */
+ public AbstractDeploymentClassLoaderPolicyModule(DeploymentUnit unit)
+ {
+ super(determineClassLoadingMetaData(unit), determineContextName(unit, true));
+ this.unit = unit;
+ ControllerContext context = unit.getTopLevel().getAttachment(ControllerContext.class);
+ setControllerContext(context);
+ }
+
+ /**
+ * Get the unit.
+ *
+ * @return the unit.
+ */
+ public DeploymentUnit getDeploymentUnit()
+ {
+ return unit;
+ }
+
+ @Override
+ public ControllerState getClassLoaderState()
+ {
+ return CLASSLOADER_STATE;
+ }
+
+ @Override
+ public void release()
+ {
+ try
+ {
+ super.release();
+ }
+ finally
+ {
+ determineContextName(unit, false);
+ }
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,952 +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.deployers.plugins.main;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
-import org.jboss.deployers.client.spi.Deployment;
-import org.jboss.deployers.client.spi.main.MainDeployer;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.DeploymentState;
-import org.jboss.deployers.spi.deployer.Deployers;
-import org.jboss.deployers.spi.deployer.DeploymentStage;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.spi.deployer.managed.ManagedDeploymentCreator;
-import org.jboss.deployers.structure.spi.DeploymentContext;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.structure.spi.StructuralDeployers;
-import org.jboss.deployers.structure.spi.helpers.RevertedDeploymentContextComparator;
-import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
-import org.jboss.logging.Logger;
-import org.jboss.managed.api.ManagedDeployment;
-import org.jboss.managed.api.ManagedObject;
-import org.jboss.util.graph.Graph;
-import org.jboss.util.graph.Vertex;
-
-/**
- * MainDeployerImpl.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author <a href="scott.stark at jboss.org">Scott Stark</a>
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- * @version $Revision$
- */
-public class MainDeployerImpl implements MainDeployer, MainDeployerStructure
-{
- /** The log */
- private static final Logger log = Logger.getLogger(MainDeployerImpl.class);
-
- /** Whether we are shutdown */
- private AtomicBoolean shutdown = new AtomicBoolean(false);
-
- /** The deployers */
- private Deployers deployers;
-
- /** The structural deployers */
- private StructuralDeployers structuralDeployers;
-
- /** The ManagedDeploymentCreator plugin */
- private ManagedDeploymentCreator mgtDeploymentCreator = null;
-
- /** The deployments by name */
- private Map<String, DeploymentContext> topLevelDeployments = new ConcurrentHashMap<String, DeploymentContext>();
-
- /** All deployments by name */
- private Map<String, DeploymentContext> allDeployments = new ConcurrentHashMap<String, DeploymentContext>();
-
- /** Deployments in error by name */
- private Map<String, DeploymentContext> errorDeployments = new ConcurrentHashMap<String, DeploymentContext>();
-
- /** Deployments missing deployers */
- private Map<String, Deployment> missingDeployers = new ConcurrentHashMap<String, Deployment>();
-
- /** The undeploy work */
- private List<DeploymentContext> undeploy = new CopyOnWriteArrayList<DeploymentContext>();
-
- /** The deploy work */
- private List<DeploymentContext> deploy = new CopyOnWriteArrayList<DeploymentContext>();
-
- /** The process lock */
- private ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-
- /** The top deployment context comparator */
- private Comparator<DeploymentContext> comparator;
- private Comparator<DeploymentContext> reverted;
-
- /**
- * Set the top deployment context comparator.
- *
- * @param comparator the deployment context comparator
- */
- public void setComparator(Comparator<DeploymentContext> comparator)
- {
- if (comparator == null)
- throw new IllegalArgumentException("Null comparator");
- this.comparator = comparator;
- this.reverted = new RevertedDeploymentContextComparator(comparator);
- }
-
- /**
- * Get the deployers
- *
- * @return the deployers
- */
- public synchronized Deployers getDeployers()
- {
- return deployers;
- }
-
- /**
- * Set the deployers
- *
- * @param deployers the deployers
- * @throws IllegalArgumentException for null deployers
- */
- public synchronized void setDeployers(Deployers deployers)
- {
- if (deployers == null)
- throw new IllegalArgumentException("Null deployers");
- this.deployers = deployers;
- }
-
- /**
- * Get the structural deployers
- *
- * @return the structural deployers
- */
- public synchronized StructuralDeployers getStructuralDeployers()
- {
- return structuralDeployers;
- }
-
- /**
- * Set the structural deployers
- *
- * @param deployers the deployers
- * @throws IllegalArgumentException for null deployers
- */
- public synchronized void setStructuralDeployers(StructuralDeployers deployers)
- {
- if (deployers == null)
- throw new IllegalArgumentException("Null deployers");
- structuralDeployers = deployers;
- }
-
- public ManagedDeploymentCreator getMgtDeploymentCreator()
- {
- return mgtDeploymentCreator;
- }
-
- public void setMgtDeploymentCreator(ManagedDeploymentCreator mgtDeploymentCreator)
- {
- this.mgtDeploymentCreator = mgtDeploymentCreator;
- }
-
- public Deployment getDeployment(String name)
- {
- DeploymentContext context = getTopLevelDeploymentContext(name);
- if (context == null)
- return null;
- return context.getDeployment();
- }
-
- @Deprecated
- public DeploymentContext getDeploymentContext(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("Null name");
-
- return allDeployments.get(name);
- }
-
- @Deprecated
- public DeploymentContext getDeploymentContext(String name, boolean errorNotFound) throws DeploymentException
- {
- DeploymentContext context = getDeploymentContext(name);
- if (errorNotFound && context == null)
- throw new DeploymentException("Context " + name + " not found");
- return context;
- }
-
- public DeploymentUnit getDeploymentUnit(String name)
- {
- DeploymentContext context = getDeploymentContext(name);
- if (context == null)
- return null;
- return context.getDeploymentUnit();
- }
-
- public DeploymentUnit getDeploymentUnit(String name, boolean errorNotFound) throws DeploymentException
- {
- DeploymentUnit unit = getDeploymentUnit(name);
- if (errorNotFound && unit == null)
- throw new DeploymentException("Unit " + name + " not found");
- return unit;
- }
-
- /**
- * Get a top level deployment context by name
- *
- * @param name the name
- * @return the context
- */
- public DeploymentContext getTopLevelDeploymentContext(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("Null name");
- return topLevelDeployments.get(name);
- }
-
- public Collection<DeploymentContext> getAll()
- {
- return Collections.unmodifiableCollection(allDeployments.values());
- }
-
- public Collection<DeploymentContext> getErrors()
- {
- return Collections.unmodifiableCollection(errorDeployments.values());
- }
-
- public Collection<Deployment> getMissingDeployer()
- {
- return Collections.unmodifiableCollection(missingDeployers.values());
- }
-
- public Collection<Deployment> getTopLevel()
- {
- List<Deployment> result = new ArrayList<Deployment>();
- for (DeploymentContext context : topLevelDeployments.values())
- {
- Deployment deployment = context.getDeployment();
- if (deployment != null)
- result.add(deployment);
- else
- throw new IllegalStateException("Context has no deployment? " + context.getName());
- }
- return result;
- }
-
- public void addDeployment(Deployment deployment) throws DeploymentException
- {
- addDeployment(deployment, true);
- }
-
- /**
- * Add a deployment
- *
- * @param deployment the deployment
- * @param addToDeploy should we add this deployment to deploy collection
- * @throws DeploymentException for any error
- */
- protected void addDeployment(Deployment deployment, boolean addToDeploy) throws DeploymentException
- {
- if (deployment == null)
- throw new DeploymentException("Null context");
-
- lockRead();
- try
- {
- if (shutdown.get())
- throw new DeploymentException("The main deployer is shutdown");
-
- String name = deployment.getName();
- log.debug("Add deployment: " + name);
-
- DeploymentContext previous = topLevelDeployments.get(name);
- boolean topLevelFound = false;
- if (previous != null)
- {
- log.debug("Removing previous deployment: " + previous.getName());
- removeContext(previous, addToDeploy);
- topLevelFound = true;
- }
-
- if (topLevelFound == false)
- {
- previous = allDeployments.get(name);
- if (previous != null)
- throw new IllegalStateException("Deployment already exists as a subdeployment: " + name);
- }
-
- DeploymentContext context = null;
- try
- {
- context = determineStructure(deployment);
- if (DeploymentState.ERROR.equals(context.getState()))
- errorDeployments.put(name, context);
-
- context.getTransientAttachments().addAttachment(MainDeployer.class, this);
- topLevelDeployments.put(name, context);
- addContext(context, addToDeploy);
- }
- catch (DeploymentException e)
- {
- missingDeployers.put(name, deployment);
- throw e;
- }
- catch (Throwable t)
- {
- // was structure determined?
- if (context == null)
- missingDeployers.put(name, deployment);
-
- throw DeploymentException.rethrowAsDeploymentException("Error determining deployment structure for " + name, t);
- }
- }
- finally
- {
- unlockRead();
- }
- }
-
- public boolean removeDeployment(Deployment deployment) throws DeploymentException
- {
- return removeDeployment(deployment, true);
- }
-
- /**
- * Remove a deployment by name
- *
- * @param deployment thedeployment
- * @param addToUndeploy should we add to undeploy collection
- * @return false when the context was previously unknown
- * @throws DeploymentException for any error
- */
- protected boolean removeDeployment(Deployment deployment, boolean addToUndeploy) throws DeploymentException
- {
- if (deployment == null)
- throw new DeploymentException("Null deployment");
-
- return removeDeployment(deployment.getName(), addToUndeploy);
- }
-
- public boolean removeDeployment(String name) throws DeploymentException
- {
- return removeDeployment(name, true);
- }
-
- /**
- * Remove a deployment by name
- *
- * @param name the name of the deployment
- * @param addToUndeploy should we add to undeploy collection
- * @return false when the context was previously unknown
- * @throws DeploymentException for any error
- */
- protected boolean removeDeployment(String name, boolean addToUndeploy) throws DeploymentException
- {
- if (name == null)
- throw new DeploymentException("Null name");
-
- lockRead();
- try
- {
- if (shutdown.get())
- throw new IllegalStateException("The main deployer is shutdown");
-
- log.debug("Remove deployment context: " + name);
-
- DeploymentContext context = topLevelDeployments.remove(name);
- if (context == null)
- return false;
-
- context.getTransientAttachments().removeAttachment(MainDeployer.class);
- removeContext(context, addToUndeploy);
-
- return true;
- }
- finally
- {
- unlockRead();
- }
- }
-
- public void deploy(Deployment... deployments) throws DeploymentException
- {
- if (deployments == null)
- throw new IllegalArgumentException("Null deployments.");
-
- if (deployers == null)
- throw new IllegalStateException("No deployers");
-
- lockRead();
- try
- {
- if (shutdown.get())
- throw new IllegalStateException("The main deployer is shutdown");
-
- DeploymentContext[] contexts = new DeploymentContext[deployments.length];
- for(int i = 0; i < deployments.length; i++)
- {
- try
- {
- Deployment deployment = deployments[i];
- addDeployment(deployment, false);
- DeploymentContext context = getTopLevelDeploymentContext(deployment.getName());
- if (contexts == null)
- throw new DeploymentException("Deployment context not found: " + deployment.getName());
-
- deployers.process(Collections.singletonList(context), null);
- contexts[i] = context;
- }
- catch(Throwable t)
- {
- DeploymentContext[] deployedContexts = new DeploymentContext[i];
- System.arraycopy(contexts, 0, deployedContexts, 0, i);
- deployers.process(null, Arrays.asList(deployedContexts));
- throw DeploymentException.rethrowAsDeploymentException("Unable to deploy deployments, cause: " + deployments[i], t);
- }
- }
- try
- {
- deployers.checkComplete(contexts);
- }
- catch (DeploymentException e)
- {
- deployers.process(null, Arrays.asList(contexts));
- throw e;
- }
- }
- finally
- {
- unlockRead();
- }
- }
-
- public void undeploy(Deployment... deployments) throws DeploymentException
- {
- if (deployments == null)
- throw new IllegalArgumentException("Null deployments.");
-
- if (deployers == null)
- throw new IllegalStateException("No deployers");
-
- lockRead();
- try
- {
- if (shutdown.get())
- throw new IllegalStateException("The main deployer is shutdown");
-
- for(Deployment deployment : deployments)
- {
- DeploymentContext context = getTopLevelDeploymentContext(deployment.getName());
- if (context != null)
- {
- try
- {
- removeDeployment(deployment, false);
- deployers.process(null, Collections.singletonList(context));
- }
- catch (DeploymentException e)
- {
- if (log.isTraceEnabled())
- log.trace("Ignored exception while undeploying deployment " + deployment.getName() + ":" + e);
- }
- }
- else if (log.isTraceEnabled())
- {
- log.trace("No such deployment present: " + deployment.getName());
- }
- }
- }
- finally
- {
- unlockRead();
- }
- }
-
- public void undeploy(String... names) throws DeploymentException
- {
- if (names == null)
- throw new IllegalArgumentException("Null names.");
-
- List<Deployment> deployments = new ArrayList<Deployment>();
- for(String name : names)
- {
- DeploymentContext context = getTopLevelDeploymentContext(name);
- if (context != null)
- deployments.add(context.getDeployment());
- else if (log.isTraceEnabled())
- log.trace("No such deployment present: " + name);
- }
- if (deployments.isEmpty() == false)
- undeploy(deployments.toArray(new Deployment[deployments.size()]));
- }
-
- public void process()
- {
- if (deployers == null)
- throw new IllegalStateException("No deployers");
-
- lockRead();
- try
- {
- if (shutdown.get())
- throw new IllegalStateException("The main deployer is shutdown");
-
- List<DeploymentContext> undeployContexts = null;
- List<DeploymentContext> deployContexts = null;
-
- if (undeploy.isEmpty() == false)
- {
- // Undeploy in reverse order (subdeployments first)
- undeployContexts = new ArrayList<DeploymentContext>(undeploy.size());
- for (int i = undeploy.size() - 1; i >= 0; --i)
- undeployContexts.add(undeploy.get(i));
- if (reverted != null)
- Collections.sort(undeployContexts, reverted);
- undeploy.clear();
- }
- if (deploy.isEmpty() == false)
- {
- deployContexts = new ArrayList<DeploymentContext>(deploy);
- if (comparator != null)
- Collections.sort(deployContexts, comparator);
- deploy.clear();
- }
-
- if (undeployContexts == null && deployContexts == null)
- {
- log.debug("Asked to process() when there is nothing to do.");
- return;
- }
-
- try
- {
- deployers.process(deployContexts, undeployContexts);
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Error e)
- {
- throw e;
- }
- catch (Throwable t)
- {
- throw new RuntimeException("Unexpected error in process()", t);
- }
- }
- finally
- {
- unlockRead();
- }
- }
-
- public DeploymentStage getDeploymentStage(String deploymentName) throws DeploymentException
- {
- if (deployers == null)
- throw new IllegalStateException("No deployers");
-
- lockRead();
- try
- {
- DeploymentContext context = getTopLevelDeploymentContext(deploymentName);
- if (context == null)
- return DeploymentStages.NOT_INSTALLED;
- DeploymentStage result = deployers.getDeploymentStage(context);
- if (result != null)
- return result;
- else
- return DeploymentStages.NOT_INSTALLED;
- }
- catch (Error e)
- {
- throw e;
- }
- catch (Throwable t)
- {
- throw DeploymentException.rethrowAsDeploymentException("Error getting stage for " + deploymentName, t);
- }
- finally
- {
- unlockRead();
- }
- }
-
- public void change(String deploymentName, DeploymentStage stage) throws DeploymentException
- {
- if (deployers == null)
- throw new IllegalStateException("No deployers");
-
- lockRead();
- try
- {
- DeploymentContext context = getTopLevelDeploymentContext(deploymentName);
- if (context == null)
- throw new DeploymentException("Top level deployment " + deploymentName + " not found");
- try
- {
- deployers.change(context, stage);
- }
- catch (Error e)
- {
- throw e;
- }
- catch (Throwable t)
- {
- throw DeploymentException.rethrowAsDeploymentException("Error changing context " + deploymentName + " to stage " + stage, t);
- }
- }
- finally
- {
- unlockRead();
- }
- }
-
- public void prepareShutdown()
- {
- if (deployers != null)
- deployers.shutdown();
- }
-
- public void shutdown()
- {
- prepareShutdown();
- lockWrite();
- try
- {
- while (topLevelDeployments.isEmpty() == false)
- {
- // Remove all the contexts
- for (DeploymentContext context : topLevelDeployments.values())
- {
- topLevelDeployments.remove(context.getName());
- removeContext(context, true);
- }
-
- // Do it
- process();
- }
-
- shutdown.set(true);
- }
- finally
- {
- unlockWrite();
- }
- }
-
- public void checkComplete() throws DeploymentException
- {
- if (deployers == null)
- throw new IllegalStateException("Null deployers");
-
- deployers.checkComplete(errorDeployments.values(), missingDeployers.values());
- }
-
- /**
- * Get the names from deployments.
- *
- * @param deployments the deployments
- * @return depolyment names
- */
- protected static String[] getDeploymentNames(Deployment... deployments)
- {
- if (deployments == null)
- throw new IllegalArgumentException("Null deployments");
-
- String[] names = new String[deployments.length];
- for(int i = 0; i < deployments.length; i++)
- {
- if (deployments[i] == null)
- throw new IllegalArgumentException("Null deployment: " + i);
- names[i] = deployments[i].getName();
- }
- return names;
- }
-
- /**
- * Get the deployment contexts.
- *
- * @param names the deployment names
- * @return depolyment contexts
- * @throws DeploymentException if context is not found
- */
- protected DeploymentContext[] getDeploymentContexts(String... names) throws DeploymentException
- {
- if (names == null)
- throw new IllegalArgumentException("Null names");
-
- DeploymentContext[] contexts = new DeploymentContext[names.length];
- for(int i = 0; i < names.length; i++)
- {
- contexts[i] = getTopLevelDeploymentContext(names[i]);
- if (contexts[i] == null)
- throw new DeploymentException("Deployment context not found: " + names[i]);
- }
-
- return contexts;
- }
-
- public void checkComplete(Deployment... deployments) throws DeploymentException
- {
- if (deployments == null)
- throw new IllegalArgumentException("Null deployments");
-
- checkComplete(getDeploymentNames(deployments));
- }
-
- public void checkComplete(String... names) throws DeploymentException
- {
- if (names == null)
- throw new IllegalArgumentException("Null names");
-
- if (deployers == null)
- throw new IllegalStateException("Null deployers");
-
- deployers.checkComplete(getDeploymentContexts(names));
- }
-
- public void checkStructureComplete(Deployment... deployments) throws DeploymentException
- {
- if (deployments == null)
- throw new IllegalArgumentException("Null deployments");
-
- checkStructureComplete(getDeploymentNames(deployments));
- }
-
- public void checkStructureComplete(String... names) throws DeploymentException
- {
- if (names == null)
- throw new IllegalArgumentException("Null names");
-
- if (deployers == null)
- throw new IllegalStateException("Null deployers");
-
- deployers.checkStructureComplete(getDeploymentContexts(names));
- }
-
- public DeploymentState getDeploymentState(String name)
- {
- DeploymentContext context = getDeploymentContext(name);
- if (context == null)
- return DeploymentState.UNDEPLOYED;
- return context.getState();
- }
-
- public ManagedDeployment getManagedDeployment(String name) throws DeploymentException
- {
- DeploymentContext context = getDeploymentContext(name, true);
- Map<String, ManagedObject> rootMOs = getManagedObjects(context);
- ManagedDeployment root = mgtDeploymentCreator.build(context.getDeploymentUnit(), rootMOs, null);
- for (DeploymentContext childContext : context.getChildren())
- {
- processManagedDeployment(childContext, root);
- }
- return root;
- }
-
- public Map<String, ManagedObject> getManagedObjects(String name) throws DeploymentException
- {
- DeploymentContext context = getDeploymentContext(name, true);
- return getManagedObjects(context);
- }
-
- public Map<String, ManagedObject> getManagedObjects(DeploymentContext context) throws DeploymentException
- {
- if (context == null)
- throw new IllegalArgumentException("Null context");
-
- if (deployers == null)
- throw new IllegalStateException("No deployers");
-
- return deployers.getManagedObjects(context);
- }
-
- public Graph<Map<String, ManagedObject>> getDeepManagedObjects(String name) throws DeploymentException
- {
- DeploymentContext context = getDeploymentContext(name);
- Graph<Map<String, ManagedObject>> managedObjectsGraph = new Graph<Map<String, ManagedObject>>();
- Vertex<Map<String, ManagedObject>> parent = new Vertex<Map<String, ManagedObject>>(context.getName());
- managedObjectsGraph.setRootVertex(parent);
- Map<String, ManagedObject> managedObjects = getManagedObjects(context);
- parent.setData(managedObjects);
- processManagedObjects(context, managedObjectsGraph, parent);
-
- return managedObjectsGraph;
- }
-
- /**
- * Get the managed objects for a context
- *
- * @param context the context
- * @param graph the graph
- * @param parent the parent node
- * @throws DeploymentException for any problem
- */
- protected void processManagedObjects(DeploymentContext context, Graph<Map<String, ManagedObject>> graph, Vertex<Map<String, ManagedObject>> parent)
- throws DeploymentException
- {
- List<DeploymentContext> children = context.getChildren();
- for(DeploymentContext child : children)
- {
- Vertex<Map<String, ManagedObject>> vertex = new Vertex<Map<String, ManagedObject>>(child.getName());
- Map<String, ManagedObject> managedObjects = getManagedObjects(context);
- vertex.setData(managedObjects);
- graph.addEdge(parent, vertex, 0);
- processManagedObjects(child, graph, vertex);
- }
- }
-
- /**
- * Recursively process the DeploymentContext into ManagedDeployments.
- *
- * @param context the context
- * @param parent the parent
- * @throws DeploymentException for any error
- */
- protected void processManagedDeployment(DeploymentContext context, ManagedDeployment parent)
- throws DeploymentException
- {
- DeploymentUnit unit = context.getDeploymentUnit();
- Map<String, ManagedObject> MOs = getManagedObjects(context);
- ManagedDeployment md = mgtDeploymentCreator.build(unit, MOs, parent);
- for (DeploymentContext childContext : context.getChildren())
- {
- processManagedDeployment(childContext, md);
- }
- }
-
- /**
- * Determine the structure of a deployment
- *
- * @param deployment the deployment
- * @return the deployment context
- * @throws DeploymentException for an error determining the deployment structure
- */
- private DeploymentContext determineStructure(Deployment deployment) throws DeploymentException
- {
- StructuralDeployers structuralDeployers = getStructuralDeployers();
- if (structuralDeployers != null)
- {
- DeploymentContext result = structuralDeployers.determineStructure(deployment);
- if (result != null)
- return result;
- }
- throw new DeploymentException("No structural deployers.");
- }
-
- /**
- * Add a context.
- *
- * @param context the context
- * @param addToDeploy should we add to deploy collection
- */
- private void addContext(DeploymentContext context, boolean addToDeploy)
- {
- allDeployments.put(context.getName(), context);
- if (context.getState() == DeploymentState.ERROR)
- {
- log.debug("Not scheduling addition of context already in error: " + context.getName() + " reason=" + context.getProblem());
- return;
- }
- context.setState(DeploymentState.DEPLOYING);
- DeploymentContext parent = context.getParent();
- log.debug("Scheduling deployment: " + context.getName() + " parent=" + parent);
-
- // Process the top level only
- if (context.isTopLevel() && addToDeploy)
- deploy.add(context);
-
- // Add all the children
- List<DeploymentContext> children = context.getChildren();
- if (children != null)
- {
- for (DeploymentContext child : children)
- addContext(child, addToDeploy);
- }
- }
-
- /**
- * Remove a context
- *
- * @param context the context
- * @param addToUndeploy add to undeploy collection
- */
- private void removeContext(DeploymentContext context, boolean addToUndeploy)
- {
- String name = context.getName();
- allDeployments.remove(name);
- errorDeployments.remove(name);
- missingDeployers.remove(name);
- if (DeploymentState.ERROR.equals(context.getState()) == false)
- context.setState(DeploymentState.UNDEPLOYING);
- DeploymentContext parent = context.getParent();
- log.debug("Scheduling undeployment: " + name + " parent=" + parent);
-
- // Process the top level only
- if (context.isTopLevel() && addToUndeploy)
- undeploy.add(context);
-
- // Remove all the children
- List<DeploymentContext> children = context.getChildren();
- if (children != null)
- {
- for (DeploymentContext child : children)
- removeContext(child, addToUndeploy);
- }
- }
-
- /**
- * Lock for read
- */
- protected void lockRead()
- {
- lock.readLock().lock();
- }
-
- /**
- * Unlock for read
- */
- protected void unlockRead()
- {
- lock.readLock().unlock();
- }
-
- /**
- * Lock for write
- */
- protected void lockWrite()
- {
- lock.writeLock().lock();
- }
-
- /**
- * Unlock for write
- */
- protected void unlockWrite()
- {
- lock.writeLock().unlock();
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,985 @@
+/*
+* 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.deployers.plugins.main;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.DeploymentState;
+import org.jboss.deployers.spi.deployer.Deployers;
+import org.jboss.deployers.spi.deployer.DeploymentStage;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.managed.ManagedDeploymentCreator;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.StructuralDeployers;
+import org.jboss.deployers.structure.spi.helpers.RevertedDeploymentContextComparator;
+import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
+import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.util.graph.Graph;
+import org.jboss.util.graph.Vertex;
+
+/**
+ * MainDeployerImpl.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="scott.stark at jboss.org">Scott Stark</a>
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ * @version $Revision$
+ */
+public class MainDeployerImpl implements MainDeployer, MainDeployerStructure
+{
+ /** The log */
+ private static final Logger log = Logger.getLogger(MainDeployerImpl.class);
+
+ /** Whether we are shutdown */
+ private AtomicBoolean shutdown = new AtomicBoolean(false);
+
+ /** The deployers */
+ private Deployers deployers;
+
+ /** The structural deployers */
+ private StructuralDeployers structuralDeployers;
+
+ /** The ManagedDeploymentCreator plugin */
+ private ManagedDeploymentCreator mgtDeploymentCreator;
+
+ /** The deployments by name */
+ private Map<String, DeploymentContext> topLevelDeployments = new ConcurrentHashMap<String, DeploymentContext>();
+
+ /** All deployments by name */
+ private Map<String, DeploymentContext> allDeployments = new ConcurrentHashMap<String, DeploymentContext>();
+
+ /** Deployments in error by name */
+ private Map<String, DeploymentContext> errorDeployments = new ConcurrentHashMap<String, DeploymentContext>();
+
+ /** Deployments missing deployers */
+ private Map<String, Deployment> missingDeployers = new ConcurrentHashMap<String, Deployment>();
+
+ /** The undeploy work */
+ private List<DeploymentContext> undeploy = new CopyOnWriteArrayList<DeploymentContext>();
+
+ /** The deploy work */
+ private List<DeploymentContext> deploy = new CopyOnWriteArrayList<DeploymentContext>();
+
+ /** The process lock */
+ private ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
+
+ /** The top deployment context comparator */
+ private Comparator<DeploymentContext> comparator;
+ private Comparator<DeploymentContext> reverted;
+
+ /**
+ * Set the top deployment context comparator.
+ *
+ * @param comparator the deployment context comparator
+ */
+ public void setComparator(Comparator<DeploymentContext> comparator)
+ {
+ if (comparator == null)
+ throw new IllegalArgumentException("Null comparator");
+ this.comparator = comparator;
+ this.reverted = new RevertedDeploymentContextComparator(comparator);
+ }
+
+ /**
+ * Get the deployers
+ *
+ * @return the deployers
+ */
+ public synchronized Deployers getDeployers()
+ {
+ return deployers;
+ }
+
+ /**
+ * Set the deployers
+ *
+ * @param deployers the deployers
+ * @throws IllegalArgumentException for null deployers
+ */
+ public synchronized void setDeployers(Deployers deployers)
+ {
+ if (deployers == null)
+ throw new IllegalArgumentException("Null deployers");
+ this.deployers = deployers;
+ }
+
+ /**
+ * Get the structural deployers
+ *
+ * @return the structural deployers
+ */
+ public synchronized StructuralDeployers getStructuralDeployers()
+ {
+ return structuralDeployers;
+ }
+
+ /**
+ * Set the structural deployers
+ *
+ * @param deployers the deployers
+ * @throws IllegalArgumentException for null deployers
+ */
+ public synchronized void setStructuralDeployers(StructuralDeployers deployers)
+ {
+ if (deployers == null)
+ throw new IllegalArgumentException("Null deployers");
+ structuralDeployers = deployers;
+ }
+
+ /**
+ * Get managed deployment creator.
+ *
+ * @return the managed deployment creator
+ */
+ public ManagedDeploymentCreator getMgtDeploymentCreator()
+ {
+ return mgtDeploymentCreator;
+ }
+
+ /**
+ * Set managed deployment creator.
+ *
+ * @param mgtDeploymentCreator the managed deployment creator
+ */
+ public void setMgtDeploymentCreator(ManagedDeploymentCreator mgtDeploymentCreator)
+ {
+ this.mgtDeploymentCreator = mgtDeploymentCreator;
+ }
+
+ public Deployment getDeployment(String name)
+ {
+ DeploymentContext context = getTopLevelDeploymentContext(name);
+ if (context == null)
+ return null;
+ return context.getDeployment();
+ }
+
+ @Deprecated
+ public DeploymentContext getDeploymentContext(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("Null name");
+
+ return allDeployments.get(name);
+ }
+
+ @Deprecated
+ public DeploymentContext getDeploymentContext(String name, boolean errorNotFound) throws DeploymentException
+ {
+ DeploymentContext context = getDeploymentContext(name);
+ if (errorNotFound && context == null)
+ throw new DeploymentException("Context " + name + " not found");
+ return context;
+ }
+
+ public DeploymentUnit getDeploymentUnit(String name)
+ {
+ DeploymentContext context = getDeploymentContext(name);
+ if (context == null)
+ return null;
+ return context.getDeploymentUnit();
+ }
+
+ public DeploymentUnit getDeploymentUnit(String name, boolean errorNotFound) throws DeploymentException
+ {
+ DeploymentUnit unit = getDeploymentUnit(name);
+ if (errorNotFound && unit == null)
+ throw new DeploymentException("Unit " + name + " not found");
+ return unit;
+ }
+
+ /**
+ * Get a top level deployment context by name
+ *
+ * @param name the name
+ * @return the context
+ */
+ public DeploymentContext getTopLevelDeploymentContext(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("Null name");
+ return topLevelDeployments.get(name);
+ }
+
+ // TODO - introduce some interface or push to MDStructure
+
+ /**
+ * Get all deployments.
+ *
+ * @return all deployments
+ */
+ public Collection<DeploymentContext> getAll()
+ {
+ return Collections.unmodifiableCollection(allDeployments.values());
+ }
+
+ /**
+ * Get errors.
+ *
+ * @return the errors
+ */
+ public Collection<DeploymentContext> getErrors()
+ {
+ return Collections.unmodifiableCollection(errorDeployments.values());
+ }
+
+ /**
+ * Get missing deployers deployments.
+ *
+ * @return the missing deployer deployments
+ */
+ public Collection<Deployment> getMissingDeployer()
+ {
+ return Collections.unmodifiableCollection(missingDeployers.values());
+ }
+
+ public Collection<Deployment> getTopLevel()
+ {
+ List<Deployment> result = new ArrayList<Deployment>();
+ for (DeploymentContext context : topLevelDeployments.values())
+ {
+ Deployment deployment = context.getDeployment();
+ if (deployment != null)
+ result.add(deployment);
+ else
+ throw new IllegalStateException("Context has no deployment? " + context.getName());
+ }
+ return result;
+ }
+
+ public void addDeployment(Deployment deployment) throws DeploymentException
+ {
+ addDeployment(deployment, true);
+ }
+
+ /**
+ * Add a deployment
+ *
+ * @param deployment the deployment
+ * @param addToDeploy should we add this deployment to deploy collection
+ * @throws DeploymentException for any error
+ */
+ protected void addDeployment(Deployment deployment, boolean addToDeploy) throws DeploymentException
+ {
+ if (deployment == null)
+ throw new DeploymentException("Null context");
+
+ lockRead();
+ try
+ {
+ if (shutdown.get())
+ throw new DeploymentException("The main deployer is shutdown");
+
+ String name = deployment.getName();
+ log.debug("Add deployment: " + name);
+
+ DeploymentContext previous = topLevelDeployments.get(name);
+ boolean topLevelFound = false;
+ if (previous != null)
+ {
+ log.debug("Removing previous deployment: " + previous.getName());
+ removeContext(previous, addToDeploy);
+ topLevelFound = true;
+ }
+
+ if (topLevelFound == false)
+ {
+ previous = allDeployments.get(name);
+ if (previous != null)
+ throw new IllegalStateException("Deployment already exists as a subdeployment: " + name);
+ }
+
+ DeploymentContext context = null;
+ try
+ {
+ context = determineStructure(deployment);
+ if (DeploymentState.ERROR.equals(context.getState()))
+ errorDeployments.put(name, context);
+
+ context.getTransientAttachments().addAttachment(MainDeployer.class, this);
+ topLevelDeployments.put(name, context);
+ addContext(context, addToDeploy);
+ }
+ catch (DeploymentException e)
+ {
+ missingDeployers.put(name, deployment);
+ throw e;
+ }
+ catch (Throwable t)
+ {
+ // was structure determined?
+ if (context == null)
+ missingDeployers.put(name, deployment);
+
+ throw DeploymentException.rethrowAsDeploymentException("Error determining deployment structure for " + name, t);
+ }
+ }
+ finally
+ {
+ unlockRead();
+ }
+ }
+
+ public boolean removeDeployment(Deployment deployment) throws DeploymentException
+ {
+ return removeDeployment(deployment, true);
+ }
+
+ /**
+ * Remove a deployment by name
+ *
+ * @param deployment thedeployment
+ * @param addToUndeploy should we add to undeploy collection
+ * @return false when the context was previously unknown
+ * @throws DeploymentException for any error
+ */
+ protected boolean removeDeployment(Deployment deployment, boolean addToUndeploy) throws DeploymentException
+ {
+ if (deployment == null)
+ throw new DeploymentException("Null deployment");
+
+ return removeDeployment(deployment.getName(), addToUndeploy);
+ }
+
+ public boolean removeDeployment(String name) throws DeploymentException
+ {
+ return removeDeployment(name, true);
+ }
+
+ /**
+ * Remove a deployment by name
+ *
+ * @param name the name of the deployment
+ * @param addToUndeploy should we add to undeploy collection
+ * @return false when the context was previously unknown
+ * @throws DeploymentException for any error
+ */
+ protected boolean removeDeployment(String name, boolean addToUndeploy) throws DeploymentException
+ {
+ if (name == null)
+ throw new DeploymentException("Null name");
+
+ lockRead();
+ try
+ {
+ if (shutdown.get())
+ throw new IllegalStateException("The main deployer is shutdown");
+
+ log.debug("Remove deployment context: " + name);
+
+ DeploymentContext context = topLevelDeployments.remove(name);
+ if (context == null)
+ return false;
+
+ context.getTransientAttachments().removeAttachment(MainDeployer.class);
+ removeContext(context, addToUndeploy);
+
+ return true;
+ }
+ finally
+ {
+ unlockRead();
+ }
+ }
+
+ public void deploy(Deployment... deployments) throws DeploymentException
+ {
+ if (deployments == null)
+ throw new IllegalArgumentException("Null deployments.");
+
+ if (deployers == null)
+ throw new IllegalStateException("No deployers");
+
+ lockRead();
+ try
+ {
+ if (shutdown.get())
+ throw new IllegalStateException("The main deployer is shutdown");
+
+ DeploymentContext[] contexts = new DeploymentContext[deployments.length];
+ for(int i = 0; i < deployments.length; i++)
+ {
+ try
+ {
+ Deployment deployment = deployments[i];
+ addDeployment(deployment, false);
+ DeploymentContext context = getTopLevelDeploymentContext(deployment.getName());
+ if (contexts == null)
+ throw new DeploymentException("Deployment context not found: " + deployment.getName());
+
+ deployers.process(Collections.singletonList(context), null);
+ contexts[i] = context;
+ }
+ catch(Throwable t)
+ {
+ DeploymentContext[] deployedContexts = new DeploymentContext[i];
+ System.arraycopy(contexts, 0, deployedContexts, 0, i);
+ deployers.process(null, Arrays.asList(deployedContexts));
+ throw DeploymentException.rethrowAsDeploymentException("Unable to deploy deployments, cause: " + deployments[i], t);
+ }
+ }
+ try
+ {
+ deployers.checkComplete(contexts);
+ }
+ catch (DeploymentException e)
+ {
+ deployers.process(null, Arrays.asList(contexts));
+ throw e;
+ }
+ }
+ finally
+ {
+ unlockRead();
+ }
+ }
+
+ public void undeploy(Deployment... deployments) throws DeploymentException
+ {
+ if (deployments == null)
+ throw new IllegalArgumentException("Null deployments.");
+
+ if (deployers == null)
+ throw new IllegalStateException("No deployers");
+
+ lockRead();
+ try
+ {
+ if (shutdown.get())
+ throw new IllegalStateException("The main deployer is shutdown");
+
+ for(Deployment deployment : deployments)
+ {
+ DeploymentContext context = getTopLevelDeploymentContext(deployment.getName());
+ if (context != null)
+ {
+ try
+ {
+ removeDeployment(deployment, false);
+ deployers.process(null, Collections.singletonList(context));
+ }
+ catch (DeploymentException e)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Ignored exception while undeploying deployment " + deployment.getName() + ":" + e);
+ }
+ }
+ else if (log.isTraceEnabled())
+ {
+ log.trace("No such deployment present: " + deployment.getName());
+ }
+ }
+ }
+ finally
+ {
+ unlockRead();
+ }
+ }
+
+ public void undeploy(String... names) throws DeploymentException
+ {
+ if (names == null)
+ throw new IllegalArgumentException("Null names.");
+
+ List<Deployment> deployments = new ArrayList<Deployment>();
+ for(String name : names)
+ {
+ DeploymentContext context = getTopLevelDeploymentContext(name);
+ if (context != null)
+ deployments.add(context.getDeployment());
+ else if (log.isTraceEnabled())
+ log.trace("No such deployment present: " + name);
+ }
+ if (deployments.isEmpty() == false)
+ undeploy(deployments.toArray(new Deployment[deployments.size()]));
+ }
+
+ public void process()
+ {
+ if (deployers == null)
+ throw new IllegalStateException("No deployers");
+
+ lockRead();
+ try
+ {
+ if (shutdown.get())
+ throw new IllegalStateException("The main deployer is shutdown");
+
+ List<DeploymentContext> undeployContexts = null;
+ List<DeploymentContext> deployContexts = null;
+
+ if (undeploy.isEmpty() == false)
+ {
+ // Undeploy in reverse order (subdeployments first)
+ undeployContexts = new ArrayList<DeploymentContext>(undeploy.size());
+ for (int i = undeploy.size() - 1; i >= 0; --i)
+ undeployContexts.add(undeploy.get(i));
+ if (reverted != null)
+ Collections.sort(undeployContexts, reverted);
+ undeploy.clear();
+ }
+ if (deploy.isEmpty() == false)
+ {
+ deployContexts = new ArrayList<DeploymentContext>(deploy);
+ if (comparator != null)
+ Collections.sort(deployContexts, comparator);
+ deploy.clear();
+ }
+
+ if (undeployContexts == null && deployContexts == null)
+ {
+ log.debug("Asked to process() when there is nothing to do.");
+ return;
+ }
+
+ try
+ {
+ deployers.process(deployContexts, undeployContexts);
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Error e)
+ {
+ throw e;
+ }
+ catch (Throwable t)
+ {
+ throw new RuntimeException("Unexpected error in process()", t);
+ }
+ }
+ finally
+ {
+ unlockRead();
+ }
+ }
+
+ public DeploymentStage getDeploymentStage(String deploymentName) throws DeploymentException
+ {
+ if (deployers == null)
+ throw new IllegalStateException("No deployers");
+
+ lockRead();
+ try
+ {
+ DeploymentContext context = getTopLevelDeploymentContext(deploymentName);
+ if (context == null)
+ return DeploymentStages.NOT_INSTALLED;
+ DeploymentStage result = deployers.getDeploymentStage(context);
+ if (result != null)
+ return result;
+ else
+ return DeploymentStages.NOT_INSTALLED;
+ }
+ catch (Error e)
+ {
+ throw e;
+ }
+ catch (Throwable t)
+ {
+ throw DeploymentException.rethrowAsDeploymentException("Error getting stage for " + deploymentName, t);
+ }
+ finally
+ {
+ unlockRead();
+ }
+ }
+
+ public void change(String deploymentName, DeploymentStage stage) throws DeploymentException
+ {
+ if (deployers == null)
+ throw new IllegalStateException("No deployers");
+
+ lockRead();
+ try
+ {
+ DeploymentContext context = getTopLevelDeploymentContext(deploymentName);
+ if (context == null)
+ throw new DeploymentException("Top level deployment " + deploymentName + " not found");
+ try
+ {
+ deployers.change(context, stage);
+ }
+ catch (Error e)
+ {
+ throw e;
+ }
+ catch (Throwable t)
+ {
+ throw DeploymentException.rethrowAsDeploymentException("Error changing context " + deploymentName + " to stage " + stage, t);
+ }
+ }
+ finally
+ {
+ unlockRead();
+ }
+ }
+
+ public void prepareShutdown()
+ {
+ if (deployers != null)
+ deployers.shutdown();
+ }
+
+ public void shutdown()
+ {
+ prepareShutdown();
+ lockWrite();
+ try
+ {
+ while (topLevelDeployments.isEmpty() == false)
+ {
+ // Remove all the contexts
+ for (DeploymentContext context : topLevelDeployments.values())
+ {
+ topLevelDeployments.remove(context.getName());
+ removeContext(context, true);
+ }
+
+ // Do it
+ process();
+ }
+
+ shutdown.set(true);
+ }
+ finally
+ {
+ unlockWrite();
+ }
+ }
+
+ public void checkComplete() throws DeploymentException
+ {
+ if (deployers == null)
+ throw new IllegalStateException("Null deployers");
+
+ deployers.checkComplete(errorDeployments.values(), missingDeployers.values());
+ }
+
+ /**
+ * Get the names from deployments.
+ *
+ * @param deployments the deployments
+ * @return depolyment names
+ */
+ protected static String[] getDeploymentNames(Deployment... deployments)
+ {
+ if (deployments == null)
+ throw new IllegalArgumentException("Null deployments");
+
+ String[] names = new String[deployments.length];
+ for(int i = 0; i < deployments.length; i++)
+ {
+ if (deployments[i] == null)
+ throw new IllegalArgumentException("Null deployment: " + i);
+ names[i] = deployments[i].getName();
+ }
+ return names;
+ }
+
+ /**
+ * Get the deployment contexts.
+ *
+ * @param names the deployment names
+ * @return depolyment contexts
+ * @throws DeploymentException if context is not found
+ */
+ protected DeploymentContext[] getDeploymentContexts(String... names) throws DeploymentException
+ {
+ if (names == null)
+ throw new IllegalArgumentException("Null names");
+
+ DeploymentContext[] contexts = new DeploymentContext[names.length];
+ for(int i = 0; i < names.length; i++)
+ {
+ contexts[i] = getTopLevelDeploymentContext(names[i]);
+ if (contexts[i] == null)
+ throw new DeploymentException("Deployment context not found: " + names[i]);
+ }
+
+ return contexts;
+ }
+
+ public void checkComplete(Deployment... deployments) throws DeploymentException
+ {
+ if (deployments == null)
+ throw new IllegalArgumentException("Null deployments");
+
+ checkComplete(getDeploymentNames(deployments));
+ }
+
+ public void checkComplete(String... names) throws DeploymentException
+ {
+ if (names == null)
+ throw new IllegalArgumentException("Null names");
+
+ if (deployers == null)
+ throw new IllegalStateException("Null deployers");
+
+ deployers.checkComplete(getDeploymentContexts(names));
+ }
+
+ public void checkStructureComplete(Deployment... deployments) throws DeploymentException
+ {
+ if (deployments == null)
+ throw new IllegalArgumentException("Null deployments");
+
+ checkStructureComplete(getDeploymentNames(deployments));
+ }
+
+ public void checkStructureComplete(String... names) throws DeploymentException
+ {
+ if (names == null)
+ throw new IllegalArgumentException("Null names");
+
+ if (deployers == null)
+ throw new IllegalStateException("Null deployers");
+
+ deployers.checkStructureComplete(getDeploymentContexts(names));
+ }
+
+ public DeploymentState getDeploymentState(String name)
+ {
+ DeploymentContext context = getDeploymentContext(name);
+ if (context == null)
+ return DeploymentState.UNDEPLOYED;
+ return context.getState();
+ }
+
+ public ManagedDeployment getManagedDeployment(String name) throws DeploymentException
+ {
+ if (mgtDeploymentCreator == null)
+ throw new IllegalArgumentException("Null managed deployment creator.");
+
+ DeploymentContext context = getDeploymentContext(name, true);
+ Map<String, ManagedObject> rootMOs = getManagedObjects(context);
+ ManagedDeployment root = mgtDeploymentCreator.build(context.getDeploymentUnit(), rootMOs, null);
+ for (DeploymentContext childContext : context.getChildren())
+ {
+ processManagedDeployment(childContext, root);
+ }
+ return root;
+ }
+
+ public Map<String, ManagedObject> getManagedObjects(String name) throws DeploymentException
+ {
+ DeploymentContext context = getDeploymentContext(name, true);
+ return getManagedObjects(context);
+ }
+
+ public Map<String, ManagedObject> getManagedObjects(DeploymentContext context) throws DeploymentException
+ {
+ if (context == null)
+ throw new IllegalArgumentException("Null context");
+
+ if (deployers == null)
+ throw new IllegalStateException("No deployers");
+
+ return deployers.getManagedObjects(context);
+ }
+
+ public Graph<Map<String, ManagedObject>> getDeepManagedObjects(String name) throws DeploymentException
+ {
+ DeploymentContext context = getDeploymentContext(name);
+ Graph<Map<String, ManagedObject>> managedObjectsGraph = new Graph<Map<String, ManagedObject>>();
+ Vertex<Map<String, ManagedObject>> parent = new Vertex<Map<String, ManagedObject>>(context.getName());
+ managedObjectsGraph.setRootVertex(parent);
+ Map<String, ManagedObject> managedObjects = getManagedObjects(context);
+ parent.setData(managedObjects);
+ processManagedObjects(context, managedObjectsGraph, parent);
+
+ return managedObjectsGraph;
+ }
+
+ /**
+ * Get the managed objects for a context
+ *
+ * @param context the context
+ * @param graph the graph
+ * @param parent the parent node
+ * @throws DeploymentException for any problem
+ */
+ protected void processManagedObjects(DeploymentContext context, Graph<Map<String, ManagedObject>> graph, Vertex<Map<String, ManagedObject>> parent)
+ throws DeploymentException
+ {
+ List<DeploymentContext> children = context.getChildren();
+ for(DeploymentContext child : children)
+ {
+ Vertex<Map<String, ManagedObject>> vertex = new Vertex<Map<String, ManagedObject>>(child.getName());
+ Map<String, ManagedObject> managedObjects = getManagedObjects(context);
+ vertex.setData(managedObjects);
+ graph.addEdge(parent, vertex, 0);
+ processManagedObjects(child, graph, vertex);
+ }
+ }
+
+ /**
+ * Recursively process the DeploymentContext into ManagedDeployments.
+ *
+ * @param context the context
+ * @param parent the parent
+ * @throws DeploymentException for any error
+ */
+ protected void processManagedDeployment(DeploymentContext context, ManagedDeployment parent)
+ throws DeploymentException
+ {
+ if (mgtDeploymentCreator == null)
+ throw new IllegalArgumentException("Null managed deployment creator.");
+
+ DeploymentUnit unit = context.getDeploymentUnit();
+ Map<String, ManagedObject> MOs = getManagedObjects(context);
+ ManagedDeployment md = mgtDeploymentCreator.build(unit, MOs, parent);
+ for (DeploymentContext childContext : context.getChildren())
+ {
+ processManagedDeployment(childContext, md);
+ }
+ }
+
+ /**
+ * Determine the structure of a deployment
+ *
+ * @param deployment the deployment
+ * @return the deployment context
+ * @throws DeploymentException for an error determining the deployment structure
+ */
+ private DeploymentContext determineStructure(Deployment deployment) throws DeploymentException
+ {
+ StructuralDeployers structuralDeployers = getStructuralDeployers();
+ if (structuralDeployers != null)
+ {
+ DeploymentContext result = structuralDeployers.determineStructure(deployment);
+ if (result != null)
+ return result;
+ }
+ throw new DeploymentException("No structural deployers.");
+ }
+
+ /**
+ * Add a context.
+ *
+ * @param context the context
+ * @param addToDeploy should we add to deploy collection
+ */
+ private void addContext(DeploymentContext context, boolean addToDeploy)
+ {
+ allDeployments.put(context.getName(), context);
+ if (context.getState() == DeploymentState.ERROR)
+ {
+ log.debug("Not scheduling addition of context already in error: " + context.getName() + " reason=" + context.getProblem());
+ return;
+ }
+ context.setState(DeploymentState.DEPLOYING);
+ DeploymentContext parent = context.getParent();
+ log.debug("Scheduling deployment: " + context.getName() + " parent=" + parent);
+
+ // Process the top level only
+ if (context.isTopLevel() && addToDeploy)
+ deploy.add(context);
+
+ // Add all the children
+ List<DeploymentContext> children = context.getChildren();
+ if (children != null)
+ {
+ for (DeploymentContext child : children)
+ addContext(child, addToDeploy);
+ }
+ }
+
+ /**
+ * Remove a context
+ *
+ * @param context the context
+ * @param addToUndeploy add to undeploy collection
+ */
+ private void removeContext(DeploymentContext context, boolean addToUndeploy)
+ {
+ String name = context.getName();
+ allDeployments.remove(name);
+ errorDeployments.remove(name);
+ missingDeployers.remove(name);
+ if (DeploymentState.ERROR.equals(context.getState()) == false)
+ context.setState(DeploymentState.UNDEPLOYING);
+ DeploymentContext parent = context.getParent();
+ log.debug("Scheduling undeployment: " + name + " parent=" + parent);
+
+ // Process the top level only
+ if (context.isTopLevel() && addToUndeploy)
+ undeploy.add(context);
+
+ // Remove all the children
+ List<DeploymentContext> children = context.getChildren();
+ if (children != null)
+ {
+ for (DeploymentContext child : children)
+ removeContext(child, addToUndeploy);
+ }
+ }
+
+ /**
+ * Lock for read
+ */
+ protected void lockRead()
+ {
+ lock.readLock().lock();
+ }
+
+ /**
+ * Unlock for read
+ */
+ protected void unlockRead()
+ {
+ lock.readLock().unlock();
+ }
+
+ /**
+ * Lock for write
+ */
+ protected void lockWrite()
+ {
+ lock.writeLock().lock();
+ }
+
+ /**
+ * Unlock for write
+ */
+ protected void unlockWrite()
+ {
+ lock.writeLock().unlock();
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,88 +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.deployers.plugins.sort;
-
-import java.util.Set;
-
-import org.jboss.deployers.spi.deployer.Deployer;
-
-/**
- * Representing deployer as a domino.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class DeployerDomino implements Domino<Set<String>>
-{
- private Deployer deployer;
- private Dots<Set<String>> head;
- private Dots<Set<String>> tail;
-
- public DeployerDomino(Deployer deployer)
- {
- if (deployer == null)
- throw new IllegalArgumentException("Null deployer!");
- this.deployer = deployer;
- this.head = new SetDots<String>(deployer.getInputs());
- this.tail = new SetDots<String>(deployer.getOutputs());
- }
-
- public Deployer getDeployer()
- {
- return deployer;
- }
-
- public Dots<Set<String>> getHead()
- {
- return head;
- }
-
- public Dots<Set<String>> getTail()
- {
- return tail;
- }
-
- public int getRelativeOrder()
- {
- return deployer.getRelativeOrder();
- }
-
- public void setRelativeOrder(int order)
- {
- deployer.setRelativeOrder(order);
- }
-
- public String getInfo()
- {
- StringBuilder builder = new StringBuilder();
- builder.append(deployer);
- builder.append("{inputs=").append(deployer.getInputs());
- builder.append(" outputs=").append(deployer.getOutputs());
- builder.append("}\n");
- return builder.toString();
- }
-
- @Override
- public String toString()
- {
- return deployer + ", " + head + "|" + tail;
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,93 @@
+/*
+* 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.deployers.plugins.sort;
+
+import java.util.Set;
+
+import org.jboss.deployers.spi.deployer.Deployer;
+
+/**
+ * Representing deployer as a domino.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class DeployerDomino implements Domino<Set<String>>
+{
+ private Deployer deployer;
+ private Dots<Set<String>> head;
+ private Dots<Set<String>> tail;
+
+ public DeployerDomino(Deployer deployer)
+ {
+ if (deployer == null)
+ throw new IllegalArgumentException("Null deployer!");
+ this.deployer = deployer;
+ this.head = new SetDots<String>(deployer.getInputs());
+ this.tail = new SetDots<String>(deployer.getOutputs());
+ }
+
+ /**
+ * Get the underlying deployer.
+ *
+ * @return the deployer
+ */
+ public Deployer getDeployer()
+ {
+ return deployer;
+ }
+
+ public Dots<Set<String>> getHead()
+ {
+ return head;
+ }
+
+ public Dots<Set<String>> getTail()
+ {
+ return tail;
+ }
+
+ public int getRelativeOrder()
+ {
+ return deployer.getRelativeOrder();
+ }
+
+ public void setRelativeOrder(int order)
+ {
+ deployer.setRelativeOrder(order);
+ }
+
+ public String getInfo()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append(deployer);
+ builder.append("{inputs=").append(deployer.getInputs());
+ builder.append(" outputs=").append(deployer.getOutputs());
+ builder.append("}\n");
+ return builder.toString();
+ }
+
+ @Override
+ public String toString()
+ {
+ return deployer + ", " + head + "|" + tail;
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,201 +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.deployers.plugins.sort;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import static org.jboss.deployers.spi.Ordered.COMPARATOR;
-
-/**
- * Simple transition ordering using transitive closure.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- * @param <T> exact domino type
- */
-public class DominoOrdering<T extends Domino<?>>
-{
- protected String message;
-
- protected List<T> dominoes;
- protected int size;
- protected int[][] connections;
-
- public DominoOrdering(String message)
- {
- this.message = message;
- }
-
- @SuppressWarnings("unchecked")
- protected void init(List<T> dominoes, Object cause)
- {
- this.dominoes = dominoes;
- this.size = dominoes.size();
- this.connections = new int[size][size];
-
- for (int i = 0; i < size - 1; i++)
- {
- for (int j = i + 1; j < size; j++)
- {
- Domino one = dominoes.get(i);
- Domino two = dominoes.get(j);
- Dots oneHead = one.getHead();
- Dots oneTail = one.getTail();
- Dots twoHead = two.getHead();
- Dots twoTail = two.getTail();
- boolean fstXsnd = oneTail.match(twoHead);
- boolean sndXfst = twoTail.match(oneHead);
- int relation = 0;
- if (fstXsnd && sndXfst)
- {
- // pass-through deployers
- if (one.getHead().match(twoHead) && oneTail.match(twoTail))
- relation = COMPARATOR.compare(one, two);
- else
- // short circut cycle - throw exception immediately
- throwCycleException(cause);
- }
- else
- relation = fstXsnd ? -1 : (sndXfst ? 1 : 0);
- if (relation == 0)
- {
- // lazy compare on those who don't have order set
- if (one.getRelativeOrder() != 0 && two.getRelativeOrder() != 0)
- relation = one.getRelativeOrder() - two.getRelativeOrder();
- }
- connections[i][j] = relation;
- connections[j][i] = -connections[i][j];
- }
- }
- }
-
- public List<T> orderDominoes(List<T> dominoes, Object cause)
- {
- // prepare initial transitions
- init(dominoes, cause);
- // do transitive closure
- int cycle = fillTransitions(true);
- if (cycle >= 0)
- throwCycleException(cause);
- // name compare on 'uncomparable'
- fillCompareNames();
-
- List<Integer> indexes = new ArrayList<Integer>();
- for (int i = 0; i < size; i++)
- indexes.add(i);
- Collections.sort(indexes, new IndexComparator());
-
- List<T> list = new ArrayList<T>(size);
- for (Integer index : indexes)
- list.add(dominoes.get(index));
- return list;
- }
-
- /**
- * Fill transitions.
- *
- * @param fillTransitions do change
- * @return index of the domino cycle cause, -1 otherwise
- */
- protected int fillTransitions(boolean fillTransitions)
- {
- boolean changed = true;
- while (changed)
- {
- changed = false;
- for (int i = 0; i < size; i++)
- {
- for (int j = 0; j < size; j++)
- {
- int current = connections[i][j];
- if (j == i || current == 0)
- continue;
- for (int k = 0; k < size; k++)
- {
- if (k == i || k == j)
- continue;
- int lookup = connections[j][k];
- // same signum
- if (current * lookup > 0)
- {
- int next = connections[i][k];
- // cycle
- if (next * current < 0)
- {
- return i;
- }
- else if (fillTransitions && next == 0)
- {
- connections[i][k] = current;
- changed = true;
- }
- }
- }
- }
- }
- }
- return -1;
- }
-
- protected void fillCompareNames()
- {
- for (int i = 0; i < size - 1; i++)
- {
- for (int j = i + 1; j < size; j++)
- {
- if (connections[i][j] == 0)
- {
- T one = dominoes.get(i);
- T two = dominoes.get(j);
- connections[i][j] = COMPARATOR.compare(one, two);
- connections[j][i] = -connections[i][j];
- int cycle = fillTransitions(false);
- // we introduced cycle - flip the signum
- if (cycle >= 0)
- {
- connections[i][j] = -connections[i][j];
- connections[j][i] = -connections[i][j];
- }
- }
- }
- }
- }
-
- protected void throwCycleException(Object cause)
- {
- StringBuilder builder = new StringBuilder();
- builder.append(String.format(message, cause));
- for (T d : dominoes)
- builder.append(d.getInfo());
- throw new IllegalStateException(builder.toString());
- }
-
- protected class IndexComparator implements Comparator<Integer>
- {
- public int compare(Integer i1, Integer i2)
- {
- return connections[i1][i2];
- }
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,225 @@
+/*
+* 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.deployers.plugins.sort;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import static org.jboss.deployers.spi.Ordered.COMPARATOR;
+
+/**
+ * Simple transition ordering using transitive closure.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ * @param <T> exact domino type
+ */
+public class DominoOrdering<T extends Domino<?>>
+{
+ protected String message;
+
+ protected List<T> dominoes;
+ protected int size;
+ protected int[][] connections;
+
+ public DominoOrdering(String message)
+ {
+ this.message = message;
+ }
+
+ /**
+ * Initialize transitions.
+ *
+ * @param dominoes all dominoes
+ * @param cause the possible cycle cause
+ */
+ @SuppressWarnings("unchecked")
+ protected void init(List<T> dominoes, Object cause)
+ {
+ this.dominoes = dominoes;
+ this.size = dominoes.size();
+ this.connections = new int[size][size];
+
+ for (int i = 0; i < size - 1; i++)
+ {
+ for (int j = i + 1; j < size; j++)
+ {
+ Domino one = dominoes.get(i);
+ Domino two = dominoes.get(j);
+ Dots oneHead = one.getHead();
+ Dots oneTail = one.getTail();
+ Dots twoHead = two.getHead();
+ Dots twoTail = two.getTail();
+ boolean fstXsnd = oneTail.match(twoHead);
+ boolean sndXfst = twoTail.match(oneHead);
+ int relation = 0;
+ if (fstXsnd && sndXfst)
+ {
+ // pass-through deployers
+ if (one.getHead().match(twoHead) && oneTail.match(twoTail))
+ relation = COMPARATOR.compare(one, two);
+ else
+ // short circut cycle - throw exception immediately
+ throwCycleException(cause);
+ }
+ else
+ relation = fstXsnd ? -1 : (sndXfst ? 1 : 0);
+ if (relation == 0)
+ {
+ // lazy compare on those who don't have order set
+ if (one.getRelativeOrder() != 0 && two.getRelativeOrder() != 0)
+ relation = one.getRelativeOrder() - two.getRelativeOrder();
+ }
+ connections[i][j] = relation;
+ connections[j][i] = -connections[i][j];
+ }
+ }
+ }
+
+ /**
+ * Order dominoes.
+ *
+ * @param dominoes all dominoes
+ * @param cause the possible cycle cause
+ * @return ordered dominoes list
+ */
+ public List<T> orderDominoes(List<T> dominoes, Object cause)
+ {
+ // prepare initial transitions
+ init(dominoes, cause);
+ // do transitive closure
+ int cycle = fillTransitions(true);
+ if (cycle >= 0)
+ throwCycleException(cause);
+ // name compare on 'uncomparable'
+ fillCompareNames();
+
+ List<Integer> indexes = new ArrayList<Integer>();
+ for (int i = 0; i < size; i++)
+ indexes.add(i);
+ Collections.sort(indexes, new IndexComparator());
+
+ List<T> list = new ArrayList<T>(size);
+ for (Integer index : indexes)
+ list.add(dominoes.get(index));
+ return list;
+ }
+
+ /**
+ * Fill transitions.
+ *
+ * @param fillTransitions do change
+ * @return index of the domino cycle cause, -1 otherwise
+ */
+ protected int fillTransitions(boolean fillTransitions)
+ {
+ boolean changed = true;
+ while (changed)
+ {
+ changed = false;
+ for (int i = 0; i < size; i++)
+ {
+ for (int j = 0; j < size; j++)
+ {
+ int current = connections[i][j];
+ if (j == i || current == 0)
+ continue;
+ for (int k = 0; k < size; k++)
+ {
+ if (k == i || k == j)
+ continue;
+ int lookup = connections[j][k];
+ // same signum
+ if (current * lookup > 0)
+ {
+ int next = connections[i][k];
+ // cycle
+ if (next * current < 0)
+ {
+ return i;
+ }
+ else if (fillTransitions && next == 0)
+ {
+ connections[i][k] = current;
+ changed = true;
+ }
+ }
+ }
+ }
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Fill transitions with name compare.
+ */
+ protected void fillCompareNames()
+ {
+ for (int i = 0; i < size - 1; i++)
+ {
+ for (int j = i + 1; j < size; j++)
+ {
+ if (connections[i][j] == 0)
+ {
+ T one = dominoes.get(i);
+ T two = dominoes.get(j);
+ connections[i][j] = COMPARATOR.compare(one, two);
+ connections[j][i] = -connections[i][j];
+ int cycle = fillTransitions(false);
+ // we introduced cycle - flip the signum
+ if (cycle >= 0)
+ {
+ connections[i][j] = -connections[i][j];
+ connections[j][i] = -connections[i][j];
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Throw the cycle exception.
+ *
+ * @param cause the cycle cause
+ */
+ protected void throwCycleException(Object cause)
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append(String.format(message, cause));
+ for (T d : dominoes)
+ builder.append(d.getInfo());
+ throw new IllegalStateException(builder.toString());
+ }
+
+ /**
+ * The index comparator.
+ */
+ protected class IndexComparator implements Comparator<Integer>
+ {
+ public int compare(Integer i1, Integer i2)
+ {
+ return connections[i1][i2];
+ }
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,167 +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.deployers.classloading.test;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.jboss.classloading.spi.version.Version;
-import org.jboss.dependency.spi.Controller;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.deployers.client.spi.DeployerClient;
-import org.jboss.deployers.client.spi.Deployment;
-import org.jboss.deployers.plugins.main.MainDeployerImpl;
-import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.structure.spi.DeploymentContext;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext;
-import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit;
-import org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers;
-import org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder;
-import org.jboss.test.deployers.classloading.support.a.A;
-
-/**
- * ModuleRemoveUnitTestCase.
- *
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- */
-public class ModuleRemoveUnitTestCase extends ClassLoaderDependenciesTest
-{
- private Controller controller;
-
- public static Test suite()
- {
- return new TestSuite(ModuleRemoveUnitTestCase.class);
- }
-
- public ModuleRemoveUnitTestCase(String name)
- {
- super(name);
- }
-
- public void testAliasRemove() throws Exception
- {
- DeployerClient mainDeployer = getMainDeployer();
- // change structure builder
- MainDeployerImpl mdi = assertInstanceOf(mainDeployer, MainDeployerImpl.class);
- AbstractStructuralDeployers ads = assertInstanceOf(mdi.getStructuralDeployers(), AbstractStructuralDeployers.class);
- ads.setStructureBuilder(new RenamingStructureBuilder());
-
- Version v1 = Version.parseVersion("1");
- Deployment ad = createSimpleDeployment("A");
- addClassLoadingMetaData(ad, ad.getName(), v1, true, A.class);
-
- mainDeployer.deploy(ad);
- try
- {
- assertAlias(true, "A");
- }
- finally
- {
- mainDeployer.undeploy(ad);
- assertAlias(false, "A");
- }
- }
-
- public void testAliasRemoveOnChild() throws Exception
- {
- DeployerClient mainDeployer = getMainDeployer();
-
- Version v1 = Version.parseVersion("1");
- Deployment ad = createSimpleDeployment("A");
- addClassLoadingMetaData(ad, ad.getName(), v1, true, A.class);
-
- Version v2 = Version.parseVersion("2");
- ContextInfo childContextInfo = addChild(ad, "B");
- addClassLoadingMetaData(childContextInfo, "B", v2, true, A.class);
-
- mainDeployer.deploy(ad);
- try
- {
- assertAlias(true, "A/B");
- }
- finally
- {
- mainDeployer.undeploy(ad);
- assertAlias(false, "A/B");
- }
- }
-
- protected void assertAlias(boolean exists, String name) throws Exception
- {
- // this is ugly impl detail
- String controllerId = controller.getClass().getSimpleName() + "[" + System.identityHashCode(controller) + "]";
- ControllerContext alias = controller.getContext(name + "_Alias_" + controllerId, null);
- assertEquals(exists, alias != null);
- }
-
- private class RenamingStructureBuilder extends AbstractStructureBuilder
- {
- @Override
- protected DeploymentContext createRootDeploymentContext(Deployment deployment) throws Exception
- {
- return new RenamingDeploymentContext("NotA", "");
- }
- }
-
- private class RenamingDeploymentContext extends AbstractDeploymentContext
- {
- public RenamingDeploymentContext()
- {
- }
-
- public RenamingDeploymentContext(String name, String relativePath)
- {
- super(name, relativePath);
- }
-
- @Override
- protected DeploymentUnit createDeploymentUnit()
- {
- return new RenamingDeploymentUnit(this);
- }
- }
-
- private class RenamingDeploymentUnit extends AbstractDeploymentUnit
- {
- public RenamingDeploymentUnit()
- {
- }
-
- private RenamingDeploymentUnit(DeploymentContext deploymentContext)
- {
- super(deploymentContext);
- }
-
- @Override
- public String getName()
- {
- return "A";
- }
- }
-
- @Override
- protected Controller getController()
- {
- controller = super.getController();
- return controller;
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,167 @@
+/*
+* 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.deployers.classloading.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.classloading.spi.version.Version;
+import org.jboss.dependency.spi.Controller;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.plugins.main.MainDeployerImpl;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext;
+import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit;
+import org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers;
+import org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder;
+import org.jboss.test.deployers.classloading.support.a.A;
+
+/**
+ * ModuleRemoveUnitTestCase.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ModuleRemoveUnitTestCase extends ClassLoaderDependenciesTest
+{
+ private Controller controller;
+
+ public static Test suite()
+ {
+ return new TestSuite(ModuleRemoveUnitTestCase.class);
+ }
+
+ public ModuleRemoveUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testAliasRemove() throws Exception
+ {
+ DeployerClient mainDeployer = getMainDeployer();
+ // change structure builder
+ MainDeployerImpl mdi = assertInstanceOf(mainDeployer, MainDeployerImpl.class);
+ AbstractStructuralDeployers ads = assertInstanceOf(mdi.getStructuralDeployers(), AbstractStructuralDeployers.class);
+ ads.setStructureBuilder(new RenamingStructureBuilder());
+
+ Version v1 = Version.parseVersion("1");
+ Deployment ad = createSimpleDeployment("A");
+ addClassLoadingMetaData(ad, ad.getName(), v1, true, A.class);
+
+ mainDeployer.deploy(ad);
+ try
+ {
+ assertAlias(true, "A");
+ }
+ finally
+ {
+ mainDeployer.undeploy(ad);
+ assertAlias(false, "A");
+ }
+ }
+
+ public void testAliasRemoveOnChild() throws Exception
+ {
+ DeployerClient mainDeployer = getMainDeployer();
+
+ Version v1 = Version.parseVersion("1");
+ Deployment ad = createSimpleDeployment("A");
+ addClassLoadingMetaData(ad, ad.getName(), v1, true, A.class);
+
+ Version v2 = Version.parseVersion("2");
+ ContextInfo childContextInfo = addChild(ad, "B");
+ addClassLoadingMetaData(childContextInfo, "B", v2, true, A.class);
+
+ mainDeployer.deploy(ad);
+ try
+ {
+ assertAlias(true, "A/B");
+ }
+ finally
+ {
+ mainDeployer.undeploy(ad);
+ assertAlias(false, "A/B");
+ }
+ }
+
+ protected void assertAlias(boolean exists, String name) throws Exception
+ {
+ // this is ugly impl detail
+ String controllerId = controller.getClass().getSimpleName() + "[" + System.identityHashCode(controller) + "]";
+ ControllerContext alias = controller.getContext(name + "_Alias_" + controllerId, null);
+ assertEquals(exists, alias != null);
+ }
+
+ private class RenamingStructureBuilder extends AbstractStructureBuilder
+ {
+ @Override
+ protected DeploymentContext createRootDeploymentContext(Deployment deployment) throws Exception
+ {
+ return new RenamingDeploymentContext("NotA", "");
+ }
+ }
+
+ private class RenamingDeploymentContext extends AbstractDeploymentContext
+ {
+ public RenamingDeploymentContext()
+ {
+ }
+
+ public RenamingDeploymentContext(String name, String relativePath)
+ {
+ super(name, relativePath);
+ }
+
+ @Override
+ protected DeploymentUnit createDeploymentUnit()
+ {
+ return new RenamingDeploymentUnit(this);
+ }
+ }
+
+ private class RenamingDeploymentUnit extends AbstractDeploymentUnit
+ {
+ public RenamingDeploymentUnit()
+ {
+ }
+
+ private RenamingDeploymentUnit(DeploymentContext deploymentContext)
+ {
+ super(deploymentContext);
+ }
+
+ @Override
+ public String getName()
+ {
+ return "A";
+ }
+ }
+
+ @Override
+ protected Controller getController()
+ {
+ controller = super.getController();
+ return controller;
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,800 +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.deployers.deployer.test;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.jboss.deployers.client.spi.DeployerClient;
-import org.jboss.deployers.client.spi.Deployment;
-import org.jboss.test.deployers.AbstractDeployerTest;
-import org.jboss.test.deployers.deployer.support.TestFlowDeployer;
-
-/**
- * DeployerOrderingUnitTestCase.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public class DeployerFlowUnitTestCase extends AbstractDeployerTest
-{
- public static Test suite()
- {
- return new TestSuite(DeployerFlowUnitTestCase.class);
- }
-
- public DeployerFlowUnitTestCase(String name)
- {
- super(name);
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TestFlowDeployer.reset();
- }
-
- public void testSimpleInputOutputCorrectOrder() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test");
- addDeployer(main, deployer1);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test");
- addDeployer(main, deployer2);
-
- Deployment deployment = createSimpleDeployment("correctOrder");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(3, deployer2.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(5, deployer1.getDeployOrder());
- assertEquals(6, deployer2.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(3, deployer2.getUndeployOrder());
- }
-
- public void testSimpleInputOutputWrongOrder() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test");
- addDeployer(main, deployer1);
-
- Deployment deployment = createSimpleDeployment("wrongOrder");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(3, deployer2.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(5, deployer1.getDeployOrder());
- assertEquals(6, deployer2.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(3, deployer2.getUndeployOrder());
- }
-
- public void testInputOutputLoop() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setInputs("input1");
- deployer1.setOutputs("output1");
- addDeployer(main, deployer1);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("output1");
- deployer2.setOutputs("output2");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("output2");
- deployer3.setOutputs("input1");
- try
- {
- addDeployer(main, deployer3);
- fail("Should not be here!");
- }
- catch (Throwable t)
- {
- checkThrowable(IllegalStateException.class, t);
- }
- }
-
- public void testInputOutputTransient() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test");
- addDeployer(main, deployer1);
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("test");
- addDeployer(main, deployer3);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test");
- deployer2.setOutputs("test");
- addDeployer(main, deployer2);
-
- Deployment deployment = createSimpleDeployment("transient");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(7, deployer1.getDeployOrder());
- assertEquals(8, deployer2.getDeployOrder());
- assertEquals(9, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
- }
-
- public void testInputOutputTransient2() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setInputs("test");
- deployer1.setOutputs("test");
- addDeployer(main, deployer1);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test");
- addDeployer(main, deployer2);
-
- Deployment deployment = createSimpleDeployment("transient2");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(3, deployer2.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(5, deployer1.getDeployOrder());
- assertEquals(6, deployer2.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(3, deployer2.getUndeployOrder());
- }
-
- public void testInputOutputMultipleTransient() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer4 = new TestFlowDeployer("4");
- deployer4.setInputs("test");
- addDeployer(main, deployer4);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test");
- deployer2.setOutputs("test");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("test");
- deployer3.setOutputs("test");
- addDeployer(main, deployer3);
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test");
- addDeployer(main, deployer1);
-
- Deployment deployment = createSimpleDeployment("transient");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(4, deployer4.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
- assertEquals(-1, deployer4.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(4, deployer4.getDeployOrder());
- assertEquals(8, deployer1.getUndeployOrder());
- assertEquals(7, deployer2.getUndeployOrder());
- assertEquals(6, deployer3.getUndeployOrder());
- assertEquals(5, deployer4.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(9, deployer1.getDeployOrder());
- assertEquals(10, deployer2.getDeployOrder());
- assertEquals(11, deployer3.getDeployOrder());
- assertEquals(12, deployer4.getDeployOrder());
- assertEquals(8, deployer1.getUndeployOrder());
- assertEquals(7, deployer2.getUndeployOrder());
- assertEquals(6, deployer3.getUndeployOrder());
- assertEquals(5, deployer4.getUndeployOrder());
- }
-
- public void testMultipleOutput() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test1", "test2");
- addDeployer(main, deployer1);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test1");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("test2");
- addDeployer(main, deployer3);
-
- Deployment deployment = createSimpleDeployment("MultipleOutput");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(7, deployer1.getDeployOrder());
- assertEquals(8, deployer2.getDeployOrder());
- assertEquals(9, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
- }
-
- public void testMultipleInput() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("test1", "test2");
- addDeployer(main, deployer3);
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test1");
- addDeployer(main, deployer1);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setOutputs("test2");
- addDeployer(main, deployer2);
-
- Deployment deployment = createSimpleDeployment("MultipleInput");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(7, deployer1.getDeployOrder());
- assertEquals(8, deployer2.getDeployOrder());
- assertEquals(9, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
- }
-
- public void testChain() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("test2");
- addDeployer(main, deployer3);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test1");
- deployer2.setOutputs("test2");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test1");
- addDeployer(main, deployer1);
-
- Deployment deployment = createSimpleDeployment("Chain");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(7, deployer1.getDeployOrder());
- assertEquals(8, deployer2.getDeployOrder());
- assertEquals(9, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
- }
-
- public void testComplicated() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer6 = new TestFlowDeployer("6");
- deployer6.setInputs("test1", "test3");
- addDeployer(main, deployer6);
- TestFlowDeployer deployer5 = new TestFlowDeployer("5");
- deployer5.setInputs("test3");
- deployer5.setOutputs("test3");
- addDeployer(main, deployer5);
- TestFlowDeployer deployer4 = new TestFlowDeployer("4");
- deployer4.setInputs("test2");
- deployer4.setOutputs("test3");
- addDeployer(main, deployer4);
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setOutputs("test2");
- addDeployer(main, deployer3);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setOutputs("test1");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test1");
- addDeployer(main, deployer1);
-
- Deployment deployment = createSimpleDeployment("Complicated");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(4, deployer4.getDeployOrder());
- assertEquals(5, deployer5.getDeployOrder());
- assertEquals(6, deployer6.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
- assertEquals(-1, deployer4.getUndeployOrder());
- assertEquals(-1, deployer5.getUndeployOrder());
- assertEquals(-1, deployer6.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(4, deployer4.getDeployOrder());
- assertEquals(5, deployer5.getDeployOrder());
- assertEquals(6, deployer6.getDeployOrder());
- assertEquals(12, deployer1.getUndeployOrder());
- assertEquals(11, deployer2.getUndeployOrder());
- assertEquals(10, deployer3.getUndeployOrder());
- assertEquals(9, deployer4.getUndeployOrder());
- assertEquals(8, deployer5.getUndeployOrder());
- assertEquals(7, deployer6.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(13, deployer1.getDeployOrder());
- assertEquals(14, deployer2.getDeployOrder());
- assertEquals(15, deployer3.getDeployOrder());
- assertEquals(16, deployer4.getDeployOrder());
- assertEquals(17, deployer5.getDeployOrder());
- assertEquals(18, deployer6.getDeployOrder());
- assertEquals(12, deployer1.getUndeployOrder());
- assertEquals(11, deployer2.getUndeployOrder());
- assertEquals(10, deployer3.getUndeployOrder());
- assertEquals(9, deployer4.getUndeployOrder());
- assertEquals(8, deployer5.getUndeployOrder());
- assertEquals(7, deployer6.getUndeployOrder());
- }
-
- public void testIntermediateIsRelativelySorted() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer2 = new TestFlowDeployer("A");
- deployer2.setInputs("test1");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer3 = new TestFlowDeployer("B");
- addDeployer(main, deployer3);
- TestFlowDeployer deployer1 = new TestFlowDeployer("C");
- deployer1.setOutputs("test1");
- addDeployer(main, deployer1);
-
- Deployment deployment = createSimpleDeployment("IntermediateIsRelativelySorted");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(7, deployer1.getDeployOrder());
- assertEquals(8, deployer2.getDeployOrder());
- assertEquals(9, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
- }
-
- public void testTransitionOrdering() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("A");
- deployer1.setInputs("3");
- deployer1.setOutputs("4");
- addDeployer(main, deployer1);
-
- TestFlowDeployer deployer2 = new TestFlowDeployer("B");
- deployer2.setInputs("1");
- deployer2.setOutputs("2");
- addDeployer(main, deployer2);
-
- TestFlowDeployer deployer3 = new TestFlowDeployer("C");
- deployer3.setInputs("2");
- deployer3.setOutputs("3");
- addDeployer(main, deployer3);
-
- Deployment deployment = createSimpleDeployment("TransitionOrdering");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(3, deployer1.getDeployOrder());
- assertEquals(1, deployer2.getDeployOrder());
- assertEquals(2, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(3, deployer1.getDeployOrder());
- assertEquals(1, deployer2.getDeployOrder());
- assertEquals(2, deployer3.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(6, deployer2.getUndeployOrder());
- assertEquals(5, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(9, deployer1.getDeployOrder());
- assertEquals(7, deployer2.getDeployOrder());
- assertEquals(8, deployer3.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(6, deployer2.getUndeployOrder());
- assertEquals(5, deployer3.getUndeployOrder());
- }
-
- public void testSymetricDots() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setInputs("X");
- deployer1.setOutputs("B");
- addDeployer(main, deployer1);
-
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("X");
- deployer2.setOutputs("X");
- addDeployer(main, deployer2);
-
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("A");
- deployer3.setOutputs("X");
- addDeployer(main, deployer3);
-
- Deployment deployment = createSimpleDeployment("SymetricDots");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(3, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(1, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(3, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(1, deployer3.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(6, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(9, deployer1.getDeployOrder());
- assertEquals(8, deployer2.getDeployOrder());
- assertEquals(7, deployer3.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(6, deployer3.getUndeployOrder());
- }
-
- public void testDoubleCycle() throws Exception
- {
- DeployerClient main = createMainDeployer();
-
- TestFlowDeployer deployer2 = new TestFlowDeployer("A");
- deployer2.setInputs("test2");
- addDeployer(main, deployer2);
-
- TestFlowDeployer deployer3 = new TestFlowDeployer("B");
- addDeployer(main, deployer3);
-
- TestFlowDeployer deployer6 = new TestFlowDeployer("C");
- deployer6.setInputs("2ndcycle");
- addDeployer(main, deployer6);
-
- TestFlowDeployer deployer1 = new TestFlowDeployer("D");
- deployer1.setOutputs("test1");
- addDeployer(main, deployer1);
-
- TestFlowDeployer deployer4 = new TestFlowDeployer("E");
- addDeployer(main, deployer4);
-
- TestFlowDeployer deployer5 = new TestFlowDeployer("F");
- deployer5.setInputs("test1");
- deployer5.setOutputs("test2");
- addDeployer(main, deployer5);
-
- TestFlowDeployer deployer7 = new TestFlowDeployer("G");
- addDeployer(main, deployer7);
-
- TestFlowDeployer deployer8 = new TestFlowDeployer("H");
- deployer8.setOutputs("2ndcycle");
- addDeployer(main, deployer8);
-
- Deployment deployment = createSimpleDeployment("DoubleCycle");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer3.getDeployOrder());
- assertEquals(2, deployer8.getDeployOrder());
- assertEquals(3, deployer6.getDeployOrder());
- assertEquals(4, deployer1.getDeployOrder());
- assertEquals(5, deployer4.getDeployOrder());
- assertEquals(6, deployer5.getDeployOrder());
- assertEquals(7, deployer2.getDeployOrder());
- assertEquals(8, deployer7.getDeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
- assertEquals(-1, deployer8.getUndeployOrder());
- assertEquals(-1, deployer6.getUndeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer4.getUndeployOrder());
- assertEquals(-1, deployer5.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer7.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer3.getDeployOrder());
- assertEquals(2, deployer8.getDeployOrder());
- assertEquals(3, deployer6.getDeployOrder());
- assertEquals(4, deployer1.getDeployOrder());
- assertEquals(5, deployer4.getDeployOrder());
- assertEquals(6, deployer5.getDeployOrder());
- assertEquals(7, deployer2.getDeployOrder());
- assertEquals(8, deployer7.getDeployOrder());
- assertEquals(16, deployer3.getUndeployOrder());
- assertEquals(15, deployer8.getUndeployOrder());
- assertEquals(14, deployer6.getUndeployOrder());
- assertEquals(13, deployer1.getUndeployOrder());
- assertEquals(12, deployer4.getUndeployOrder());
- assertEquals(11, deployer5.getUndeployOrder());
- assertEquals(10, deployer2.getUndeployOrder());
- assertEquals(9, deployer7.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(17, deployer3.getDeployOrder());
- assertEquals(18, deployer8.getDeployOrder());
- assertEquals(19, deployer6.getDeployOrder());
- assertEquals(20, deployer1.getDeployOrder());
- assertEquals(21, deployer4.getDeployOrder());
- assertEquals(22, deployer5.getDeployOrder());
- assertEquals(23, deployer2.getDeployOrder());
- assertEquals(24, deployer7.getDeployOrder());
- assertEquals(16, deployer3.getUndeployOrder());
- assertEquals(15, deployer8.getUndeployOrder());
- assertEquals(14, deployer6.getUndeployOrder());
- assertEquals(13, deployer1.getUndeployOrder());
- assertEquals(12, deployer4.getUndeployOrder());
- assertEquals(11, deployer5.getUndeployOrder());
- assertEquals(10, deployer2.getUndeployOrder());
- assertEquals(9, deployer7.getUndeployOrder());
- }
-
- public void testOrderedThenFlowWithPassThrough() throws Exception
- {
- DeployerClient main = createMainDeployer();
-
- TestFlowDeployer deployer4 = new TestFlowDeployer("4");
- deployer4.setInputs("test");
- addDeployer(main, deployer4);
-
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setRelativeOrder(3);
- deployer3.setInputs("test");
- deployer3.setOutputs("test");
- addDeployer(main, deployer3);
-
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setRelativeOrder(2);
- addDeployer(main, deployer2);
-
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setRelativeOrder(1);
- addDeployer(main, deployer1);
-
- Deployment deployment = createSimpleDeployment("orderedThenFlowWithPassThrough");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(4, deployer4.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
- assertEquals(-1, deployer4.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(4, deployer4.getDeployOrder());
- assertEquals(8, deployer1.getUndeployOrder());
- assertEquals(7, deployer2.getUndeployOrder());
- assertEquals(6, deployer3.getUndeployOrder());
- assertEquals(5, deployer4.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(9, deployer1.getDeployOrder());
- assertEquals(10, deployer2.getDeployOrder());
- assertEquals(11, deployer3.getDeployOrder());
- assertEquals(12, deployer4.getDeployOrder());
- assertEquals(8, deployer1.getUndeployOrder());
- assertEquals(7, deployer2.getUndeployOrder());
- assertEquals(6, deployer3.getUndeployOrder());
- assertEquals(5, deployer4.getUndeployOrder());
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,845 @@
+/*
+* 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.deployers.deployer.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.test.deployers.AbstractDeployerTest;
+import org.jboss.test.deployers.deployer.support.TestFlowDeployer;
+
+/**
+ * DeployerOrderingUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class DeployerFlowUnitTestCase extends AbstractDeployerTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(DeployerFlowUnitTestCase.class);
+ }
+
+ public DeployerFlowUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ TestFlowDeployer.reset();
+ }
+
+ public void testSimpleInputOutputCorrectOrder() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test");
+ addDeployer(main, deployer1);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test");
+ addDeployer(main, deployer2);
+
+ Deployment deployment = createSimpleDeployment("correctOrder");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(3, deployer2.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(5, deployer1.getDeployOrder());
+ assertEquals(6, deployer2.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(3, deployer2.getUndeployOrder());
+ }
+
+ public void testSimpleInputOutputWrongOrder() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test");
+ addDeployer(main, deployer1);
+
+ Deployment deployment = createSimpleDeployment("wrongOrder");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(3, deployer2.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(5, deployer1.getDeployOrder());
+ assertEquals(6, deployer2.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(3, deployer2.getUndeployOrder());
+ }
+
+ public void testInputOutputLoop() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setInputs("input1");
+ deployer1.setOutputs("output1");
+ addDeployer(main, deployer1);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("output1");
+ deployer2.setOutputs("output2");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setInputs("output2");
+ deployer3.setOutputs("input1");
+ try
+ {
+ addDeployer(main, deployer3);
+ fail("Should not be here!");
+ }
+ catch (Throwable t)
+ {
+ checkThrowable(IllegalStateException.class, t);
+ }
+ }
+
+ public void testInputOutputTransient() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test");
+ addDeployer(main, deployer1);
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setInputs("test");
+ addDeployer(main, deployer3);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test");
+ deployer2.setOutputs("test");
+ addDeployer(main, deployer2);
+
+ Deployment deployment = createSimpleDeployment("transient");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(7, deployer1.getDeployOrder());
+ assertEquals(8, deployer2.getDeployOrder());
+ assertEquals(9, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+ }
+
+ public void testInputOutputTransient2() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setInputs("test");
+ deployer1.setOutputs("test");
+ addDeployer(main, deployer1);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test");
+ addDeployer(main, deployer2);
+
+ Deployment deployment = createSimpleDeployment("transient2");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(3, deployer2.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(5, deployer1.getDeployOrder());
+ assertEquals(6, deployer2.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(3, deployer2.getUndeployOrder());
+ }
+
+ public void testInputOutputMultipleTransient() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer4 = new TestFlowDeployer("4");
+ deployer4.setInputs("test");
+ addDeployer(main, deployer4);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test");
+ deployer2.setOutputs("test");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setInputs("test");
+ deployer3.setOutputs("test");
+ addDeployer(main, deployer3);
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test");
+ addDeployer(main, deployer1);
+
+ Deployment deployment = createSimpleDeployment("transient");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(4, deployer4.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+ assertEquals(-1, deployer4.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(4, deployer4.getDeployOrder());
+ assertEquals(8, deployer1.getUndeployOrder());
+ assertEquals(7, deployer2.getUndeployOrder());
+ assertEquals(6, deployer3.getUndeployOrder());
+ assertEquals(5, deployer4.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(9, deployer1.getDeployOrder());
+ assertEquals(10, deployer2.getDeployOrder());
+ assertEquals(11, deployer3.getDeployOrder());
+ assertEquals(12, deployer4.getDeployOrder());
+ assertEquals(8, deployer1.getUndeployOrder());
+ assertEquals(7, deployer2.getUndeployOrder());
+ assertEquals(6, deployer3.getUndeployOrder());
+ assertEquals(5, deployer4.getUndeployOrder());
+ }
+
+ public void testMultipleOutput() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test1", "test2");
+ addDeployer(main, deployer1);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test1");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setInputs("test2");
+ addDeployer(main, deployer3);
+
+ Deployment deployment = createSimpleDeployment("MultipleOutput");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(7, deployer1.getDeployOrder());
+ assertEquals(8, deployer2.getDeployOrder());
+ assertEquals(9, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+ }
+
+ public void testMultipleInput() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setInputs("test1", "test2");
+ addDeployer(main, deployer3);
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test1");
+ addDeployer(main, deployer1);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setOutputs("test2");
+ addDeployer(main, deployer2);
+
+ Deployment deployment = createSimpleDeployment("MultipleInput");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(7, deployer1.getDeployOrder());
+ assertEquals(8, deployer2.getDeployOrder());
+ assertEquals(9, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+ }
+
+ public void testChain() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setInputs("test2");
+ addDeployer(main, deployer3);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test1");
+ deployer2.setOutputs("test2");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test1");
+ addDeployer(main, deployer1);
+
+ Deployment deployment = createSimpleDeployment("Chain");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(7, deployer1.getDeployOrder());
+ assertEquals(8, deployer2.getDeployOrder());
+ assertEquals(9, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+ }
+
+ public void testComplicated() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer6 = new TestFlowDeployer("6");
+ deployer6.setInputs("test1", "test3");
+ addDeployer(main, deployer6);
+ TestFlowDeployer deployer5 = new TestFlowDeployer("5");
+ deployer5.setInputs("test3");
+ deployer5.setOutputs("test3");
+ addDeployer(main, deployer5);
+ TestFlowDeployer deployer4 = new TestFlowDeployer("4");
+ deployer4.setInputs("test2");
+ deployer4.setOutputs("test3");
+ addDeployer(main, deployer4);
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setOutputs("test2");
+ addDeployer(main, deployer3);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setOutputs("test1");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test1");
+ addDeployer(main, deployer1);
+
+ Deployment deployment = createSimpleDeployment("Complicated");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(4, deployer4.getDeployOrder());
+ assertEquals(5, deployer5.getDeployOrder());
+ assertEquals(6, deployer6.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+ assertEquals(-1, deployer4.getUndeployOrder());
+ assertEquals(-1, deployer5.getUndeployOrder());
+ assertEquals(-1, deployer6.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(4, deployer4.getDeployOrder());
+ assertEquals(5, deployer5.getDeployOrder());
+ assertEquals(6, deployer6.getDeployOrder());
+ assertEquals(12, deployer1.getUndeployOrder());
+ assertEquals(11, deployer2.getUndeployOrder());
+ assertEquals(10, deployer3.getUndeployOrder());
+ assertEquals(9, deployer4.getUndeployOrder());
+ assertEquals(8, deployer5.getUndeployOrder());
+ assertEquals(7, deployer6.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(13, deployer1.getDeployOrder());
+ assertEquals(14, deployer2.getDeployOrder());
+ assertEquals(15, deployer3.getDeployOrder());
+ assertEquals(16, deployer4.getDeployOrder());
+ assertEquals(17, deployer5.getDeployOrder());
+ assertEquals(18, deployer6.getDeployOrder());
+ assertEquals(12, deployer1.getUndeployOrder());
+ assertEquals(11, deployer2.getUndeployOrder());
+ assertEquals(10, deployer3.getUndeployOrder());
+ assertEquals(9, deployer4.getUndeployOrder());
+ assertEquals(8, deployer5.getUndeployOrder());
+ assertEquals(7, deployer6.getUndeployOrder());
+ }
+
+ public void testIntermediateIsRelativelySorted() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer2 = new TestFlowDeployer("A");
+ deployer2.setInputs("test1");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer3 = new TestFlowDeployer("B");
+ addDeployer(main, deployer3);
+ TestFlowDeployer deployer1 = new TestFlowDeployer("C");
+ deployer1.setOutputs("test1");
+ addDeployer(main, deployer1);
+
+ Deployment deployment = createSimpleDeployment("IntermediateIsRelativelySorted");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(7, deployer1.getDeployOrder());
+ assertEquals(8, deployer2.getDeployOrder());
+ assertEquals(9, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+ }
+
+ public void testTransitionOrdering() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("A");
+ deployer1.setInputs("3");
+ deployer1.setOutputs("4");
+ addDeployer(main, deployer1);
+
+ TestFlowDeployer deployer2 = new TestFlowDeployer("B");
+ deployer2.setInputs("1");
+ deployer2.setOutputs("2");
+ addDeployer(main, deployer2);
+
+ TestFlowDeployer deployer3 = new TestFlowDeployer("C");
+ deployer3.setInputs("2");
+ deployer3.setOutputs("3");
+ addDeployer(main, deployer3);
+
+ Deployment deployment = createSimpleDeployment("TransitionOrdering");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(3, deployer1.getDeployOrder());
+ assertEquals(1, deployer2.getDeployOrder());
+ assertEquals(2, deployer3.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(3, deployer1.getDeployOrder());
+ assertEquals(1, deployer2.getDeployOrder());
+ assertEquals(2, deployer3.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(6, deployer2.getUndeployOrder());
+ assertEquals(5, deployer3.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(9, deployer1.getDeployOrder());
+ assertEquals(7, deployer2.getDeployOrder());
+ assertEquals(8, deployer3.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(6, deployer2.getUndeployOrder());
+ assertEquals(5, deployer3.getUndeployOrder());
+ }
+
+ public void testSymetricDots() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setInputs("X");
+ deployer1.setOutputs("B");
+ addDeployer(main, deployer1);
+
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("X");
+ deployer2.setOutputs("X");
+ addDeployer(main, deployer2);
+
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setInputs("A");
+ deployer3.setOutputs("X");
+ addDeployer(main, deployer3);
+
+ Deployment deployment = createSimpleDeployment("SymetricDots");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(3, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(1, deployer3.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(3, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(1, deployer3.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(6, deployer3.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(9, deployer1.getDeployOrder());
+ assertEquals(8, deployer2.getDeployOrder());
+ assertEquals(7, deployer3.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(6, deployer3.getUndeployOrder());
+ }
+
+ public void testDoubleCycle() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+
+ TestFlowDeployer deployer2 = new TestFlowDeployer("A");
+ deployer2.setInputs("test2");
+ addDeployer(main, deployer2);
+
+ TestFlowDeployer deployer3 = new TestFlowDeployer("B");
+ addDeployer(main, deployer3);
+
+ TestFlowDeployer deployer6 = new TestFlowDeployer("C");
+ deployer6.setInputs("2ndcycle");
+ addDeployer(main, deployer6);
+
+ TestFlowDeployer deployer1 = new TestFlowDeployer("D");
+ deployer1.setOutputs("test1");
+ addDeployer(main, deployer1);
+
+ TestFlowDeployer deployer4 = new TestFlowDeployer("E");
+ addDeployer(main, deployer4);
+
+ TestFlowDeployer deployer5 = new TestFlowDeployer("F");
+ deployer5.setInputs("test1");
+ deployer5.setOutputs("test2");
+ addDeployer(main, deployer5);
+
+ TestFlowDeployer deployer7 = new TestFlowDeployer("G");
+ addDeployer(main, deployer7);
+
+ TestFlowDeployer deployer8 = new TestFlowDeployer("H");
+ deployer8.setOutputs("2ndcycle");
+ addDeployer(main, deployer8);
+
+ Deployment deployment = createSimpleDeployment("DoubleCycle");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer3.getDeployOrder());
+ assertEquals(2, deployer8.getDeployOrder());
+ assertEquals(3, deployer6.getDeployOrder());
+ assertEquals(4, deployer1.getDeployOrder());
+ assertEquals(5, deployer4.getDeployOrder());
+ assertEquals(6, deployer5.getDeployOrder());
+ assertEquals(7, deployer2.getDeployOrder());
+ assertEquals(8, deployer7.getDeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+ assertEquals(-1, deployer8.getUndeployOrder());
+ assertEquals(-1, deployer6.getUndeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer4.getUndeployOrder());
+ assertEquals(-1, deployer5.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer7.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer3.getDeployOrder());
+ assertEquals(2, deployer8.getDeployOrder());
+ assertEquals(3, deployer6.getDeployOrder());
+ assertEquals(4, deployer1.getDeployOrder());
+ assertEquals(5, deployer4.getDeployOrder());
+ assertEquals(6, deployer5.getDeployOrder());
+ assertEquals(7, deployer2.getDeployOrder());
+ assertEquals(8, deployer7.getDeployOrder());
+ assertEquals(16, deployer3.getUndeployOrder());
+ assertEquals(15, deployer8.getUndeployOrder());
+ assertEquals(14, deployer6.getUndeployOrder());
+ assertEquals(13, deployer1.getUndeployOrder());
+ assertEquals(12, deployer4.getUndeployOrder());
+ assertEquals(11, deployer5.getUndeployOrder());
+ assertEquals(10, deployer2.getUndeployOrder());
+ assertEquals(9, deployer7.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(17, deployer3.getDeployOrder());
+ assertEquals(18, deployer8.getDeployOrder());
+ assertEquals(19, deployer6.getDeployOrder());
+ assertEquals(20, deployer1.getDeployOrder());
+ assertEquals(21, deployer4.getDeployOrder());
+ assertEquals(22, deployer5.getDeployOrder());
+ assertEquals(23, deployer2.getDeployOrder());
+ assertEquals(24, deployer7.getDeployOrder());
+ assertEquals(16, deployer3.getUndeployOrder());
+ assertEquals(15, deployer8.getUndeployOrder());
+ assertEquals(14, deployer6.getUndeployOrder());
+ assertEquals(13, deployer1.getUndeployOrder());
+ assertEquals(12, deployer4.getUndeployOrder());
+ assertEquals(11, deployer5.getUndeployOrder());
+ assertEquals(10, deployer2.getUndeployOrder());
+ assertEquals(9, deployer7.getUndeployOrder());
+ }
+
+ public void testOrderedThenFlowWithPassThrough() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+
+ TestFlowDeployer deployer4 = new TestFlowDeployer("4");
+ deployer4.setInputs("test");
+ addDeployer(main, deployer4);
+
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setRelativeOrder(3);
+ deployer3.setInputs("test");
+ deployer3.setOutputs("test");
+ addDeployer(main, deployer3);
+
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setRelativeOrder(2);
+ addDeployer(main, deployer2);
+
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setRelativeOrder(1);
+ addDeployer(main, deployer1);
+
+ Deployment deployment = createSimpleDeployment("orderedThenFlowWithPassThrough");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(4, deployer4.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+ assertEquals(-1, deployer4.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(4, deployer4.getDeployOrder());
+ assertEquals(8, deployer1.getUndeployOrder());
+ assertEquals(7, deployer2.getUndeployOrder());
+ assertEquals(6, deployer3.getUndeployOrder());
+ assertEquals(5, deployer4.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(9, deployer1.getDeployOrder());
+ assertEquals(10, deployer2.getDeployOrder());
+ assertEquals(11, deployer3.getDeployOrder());
+ assertEquals(12, deployer4.getDeployOrder());
+ assertEquals(8, deployer1.getUndeployOrder());
+ assertEquals(7, deployer2.getUndeployOrder());
+ assertEquals(6, deployer3.getUndeployOrder());
+ assertEquals(5, deployer4.getUndeployOrder());
+ }
+
+ public void testWebBeansOrder() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+
+ TestFlowDeployer mcfcld = new TestFlowDeployer("ManagedConnectionFactory");
+ mcfcld.setInputs("ManagedConnectionFactoryDeploymentGroup");
+ mcfcld.setOutputs("CLMD");
+ addDeployer(main, mcfcld);
+
+ TestFlowDeployer postJBWMD = new TestFlowDeployer("PostJBossWebMetadataDeployer");
+ postJBWMD.setInputs("JBWMD", "CLMD");
+ postJBWMD.setOutputs("JBWMD", "CLMD");
+ addDeployer(main, postJBWMD);
+
+ TestFlowDeployer postEJB = new TestFlowDeployer("PostEjbJar");
+ postEJB.setInputs("EJB");
+ postEJB.setOutputs("EJB");
+ addDeployer(main, postEJB);
+
+ TestFlowDeployer warCL = new TestFlowDeployer("WarClassLoaderDeployer");
+ warCL.setInputs("JBWMD", "CLMD");
+ warCL.setOutputs("CLMD");
+ addDeployer(main, warCL);
+
+ TestFlowDeployer service = new TestFlowDeployer("ServiceCL");
+ service.setInputs("ServiceDeployment");
+ service.setOutputs("CLMD");
+ addDeployer(main, service);
+
+ TestFlowDeployer legacy = new TestFlowDeployer("Legacy");
+ legacy.setInputs("JBWMD", "WMD");
+ legacy.setOutputs("JBWMD");
+ addDeployer(main, legacy);
+
+ TestFlowDeployer cluster = new TestFlowDeployer("Cluster");
+ cluster.setInputs("JBWMD");
+ cluster.setOutputs("JBWMD");
+ addDeployer(main, cluster);
+
+ TestFlowDeployer postWMD = new TestFlowDeployer("PostWebMetadataDeployer");
+ postWMD.setInputs("JBWMD");
+ postWMD.setOutputs("JBWMD");
+ addDeployer(main, postWMD);
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-spi/pom.xml 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,21 +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.deployers</groupId>
- <artifactId>jboss-deployers</artifactId>
- <version>2.0.4-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-deployers-spi</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Deployers SPI</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Deployers SPI</description>
- <!-- Do not add version information here, use ../build/pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-structure-spi</artifactId>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/pom.xml (from rev 83489, projects/jboss-deployers/branches/Branch_2_0/deployers-spi/pom.xml)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/pom.xml (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,21 @@
+<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.deployers</groupId>
+ <artifactId>jboss-deployers</artifactId>
+ <version>2.0.4.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-deployers-spi</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Deployers SPI</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Deployers SPI</description>
+ <!-- Do not add version information here, use ../build/pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-structure-spi</artifactId>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,116 +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.deployers.spi.deployer.helpers;
-
-import java.util.List;
-import java.util.ArrayList;
-
-import org.jboss.logging.Logger;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.spi.DeploymentException;
-
-/**
- * Simple deployment visitor.
- *
- * @param <C> exact component type
- * @param <T> exact deployment type
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public abstract class AbstractDeploymentVisitor<C, T> extends ComponentAdapter<C> implements DeploymentVisitor<T>
-{
- private Logger log = Logger.getLogger(getClass());
-
- protected String getAttachmentName(C attachment)
- {
- return getComponentType().getName();
- }
-
- /**
- * Get components from deployment.
- *
- * @param deployment the deployment
- * @return list of components
- */
- protected abstract List<? extends C> getComponents(T deployment);
-
- /**
- * Get the component type.
- *
- * @return the component type
- */
- protected abstract Class<C> getComponentType();
-
- public void deploy(DeploymentUnit unit, T deployment) throws DeploymentException
- {
- List<? extends C> components = getComponents(deployment);
- if (components != null && components.isEmpty() == false)
- {
- List<C> visited = new ArrayList<C>();
- try
- {
- for (C component : components)
- {
- addComponent(unit, component);
- visited.add(component);
- }
- }
- catch (Throwable t)
- {
- for (int i = visited.size() - 1; i >= 0; i--)
- {
- safeRemoveComponent(unit, visited.get(i));
- }
- throw DeploymentException.rethrowAsDeploymentException("Error deploying: " + unit.getName(), t);
- }
- }
- }
-
- public void undeploy(DeploymentUnit unit, T deployment)
- {
- List<? extends C> components = getComponents(deployment);
- if (components != null && components.isEmpty() == false)
- {
- for (C component : components)
- {
- safeRemoveComponent(unit, component);
- }
- }
- }
-
- /**
- * Ignore all error during component removal.
- *
- * @param unit the deployment unit
- * @param attachment the attachment
- */
- protected void safeRemoveComponent(DeploymentUnit unit, C attachment)
- {
- try
- {
- removeComponent(unit, attachment);
- }
- catch (Throwable ignored)
- {
- log.warn("Error during component removal: " + unit.getName(), ignored);
- }
- }
-}
\ No newline at end of file
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,117 @@
+/*
+* 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.deployers.spi.deployer.helpers;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import org.jboss.logging.Logger;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.spi.DeploymentException;
+
+/**
+ * Simple deployment visitor.
+ *
+ * @param <C> exact component type
+ * @param <T> exact deployment type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractDeploymentVisitor<C, T> extends ComponentAdapter<C> implements DeploymentVisitor<T>
+{
+ private Logger log = Logger.getLogger(getClass());
+
+ protected String getAttachmentName(C attachment)
+ {
+ return getComponentType().getName();
+ }
+
+ /**
+ * Get components from deployment.
+ *
+ * @param deployment the deployment
+ * @return list of components
+ */
+ // TODO - change to Iterable - JBDEPLOY-134
+ protected abstract List<? extends C> getComponents(T deployment);
+
+ /**
+ * Get the component type.
+ *
+ * @return the component type
+ */
+ protected abstract Class<C> getComponentType();
+
+ public void deploy(DeploymentUnit unit, T deployment) throws DeploymentException
+ {
+ List<? extends C> components = getComponents(deployment);
+ if (components != null && components.isEmpty() == false)
+ {
+ List<C> visited = new ArrayList<C>();
+ try
+ {
+ for (C component : components)
+ {
+ addComponent(unit, component);
+ visited.add(component);
+ }
+ }
+ catch (Throwable t)
+ {
+ for (int i = visited.size() - 1; i >= 0; i--)
+ {
+ safeRemoveComponent(unit, visited.get(i));
+ }
+ throw DeploymentException.rethrowAsDeploymentException("Error deploying: " + unit.getName(), t);
+ }
+ }
+ }
+
+ public void undeploy(DeploymentUnit unit, T deployment)
+ {
+ List<? extends C> components = getComponents(deployment);
+ if (components != null && components.isEmpty() == false)
+ {
+ for (C component : components)
+ {
+ safeRemoveComponent(unit, component);
+ }
+ }
+ }
+
+ /**
+ * Ignore all error during component removal.
+ *
+ * @param unit the deployment unit
+ * @param attachment the attachment
+ */
+ protected void safeRemoveComponent(DeploymentUnit unit, C attachment)
+ {
+ try
+ {
+ removeComponent(unit, attachment);
+ }
+ catch (Throwable ignored)
+ {
+ log.warn("Error during component removal: " + unit.getName(), ignored);
+ }
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/pom.xml 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,132 +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.deployers</groupId>
- <artifactId>jboss-deployers</artifactId>
- <version>2.0.4-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-deployers-structure-spi</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Deployers Structure SPI</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Deployers Structure SPI</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>
- </plugins>
- </build>
-
- <!-- Do not add version information here, use ../pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.integration</groupId>
- <artifactId>jboss-classloading-spi</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </dependency>
- <!-- Test dependencies -->
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <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>
\ No newline at end of file
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/pom.xml (from rev 83489, projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/pom.xml)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/pom.xml (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,132 @@
+<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.deployers</groupId>
+ <artifactId>jboss-deployers</artifactId>
+ <version>2.0.4.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-deployers-structure-spi</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Deployers Structure SPI</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Deployers Structure SPI</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>
+ </plugins>
+ </build>
+
+ <!-- Do not add version information here, use ../pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-classloading-spi</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <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>
\ No newline at end of file
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/StructureProcessor.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/StructureProcessor.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/StructureProcessor.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/StructureProcessor.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.deployers.structure.spi;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+
+/**
+ * Pre and post structure metadata processor.
+ *
+ * @author ales.justin at jboss.org
+ */
+public interface StructureProcessor
+{
+ /**
+ * Prepare structure metadata.
+ *
+ * @param deployment the deployment
+ * @param structureMetaData the structure metadata
+ */
+ void prepareStructureMetaData(Deployment deployment, StructureMetaData structureMetaData);
+
+ /**
+ * Prepare context info.
+ *
+ * @param parentDeploymentContext the parent deployment context
+ * @param contextInfo the context info
+ */
+ void prepareContextInfo(DeploymentContext parentDeploymentContext, ContextInfo contextInfo);
+
+ /**
+ * Apply structure metadata.
+ *
+ * @param deploymentContext the deployment context
+ * @param structureMetaData the structure metadata
+ */
+ void applyStructureMetaData(DeploymentContext deploymentContext, StructureMetaData structureMetaData);
+
+ /**
+ * Apply context info.
+ *
+ * @param deploymentContext the deployment context
+ * @param contextInfo the context info
+ */
+ void applyContextInfo(DeploymentContext deploymentContext, ContextInfo contextInfo);
+}
\ No newline at end of file
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,241 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, 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.deployers.structure.spi.helpers;
-
-import java.lang.reflect.Field;
-import java.util.Comparator;
-import java.util.List;
-
-import org.jboss.deployers.client.spi.Deployment;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.DeploymentState;
-import org.jboss.deployers.spi.attachments.Attachments;
-import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.spi.structure.StructureMetaData;
-import org.jboss.deployers.spi.structure.StructureMetaDataFactory;
-import org.jboss.deployers.structure.spi.DeploymentContext;
-import org.jboss.deployers.structure.spi.StructureBuilder;
-import org.jboss.logging.Logger;
-
-/**
- * AbstractStructureBuilder.
- *
- * @author <a href="adrian at jboss.org">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public class AbstractStructureBuilder implements StructureBuilder
-{
- /** The log */
- private final Logger log = Logger.getLogger(getClass());
-
- public DeploymentContext populateContext(Deployment deployment, StructureMetaData metaData) throws DeploymentException
- {
- if (deployment == null)
- throw new IllegalArgumentException("Null deployment");
- if (metaData == null)
- throw new IllegalArgumentException("Null metaData");
-
- boolean trace = log.isTraceEnabled();
- if (trace)
- log.trace("Populating deployment " + deployment.getName() + " metaData=" + metaData);
-
- DeploymentContext result;
- try
- {
- result = createRootDeploymentContext(deployment, metaData);
- if (result == null)
- throw new IllegalStateException("Root deployment context is null");
- result.setDeployment(deployment);
-
- ContextInfo contextInfo = metaData.getContext("");
- if (contextInfo == null)
- contextInfo = StructureMetaDataFactory.createContextInfo("", null);
- contextInfo.setPredeterminedManagedObjects(deployment.getPredeterminedManagedObjects());
- applyContextInfo(result, contextInfo);
- }
- catch (Throwable t)
- {
- throw DeploymentException.rethrowAsDeploymentException("Error populating deployment " + deployment.getName(), t);
- }
-
- try
- {
- result.getTransientManagedObjects().addAttachment(StructureMetaData.class, metaData);
- populateContext(result, metaData);
- }
- catch (Throwable t)
- {
- result.setProblem(t);
- result.setState(DeploymentState.ERROR);
- log.warn("Error populating deployment " + deployment.getName(), t);
- }
- return result;
- }
-
- /**
- * Populate the child deployment contexts
- *
- * @param context the context
- * @param metaData the metadata
- * @throws Exception for any error
- */
- protected void populateContext(DeploymentContext context, StructureMetaData metaData) throws Exception
- {
- if (context == null)
- throw new IllegalArgumentException("Null context");
- if (metaData == null)
- throw new IllegalArgumentException("Null metaData");
-
- boolean trace = log.isTraceEnabled();
- if (trace)
- log.trace("Populating Context " + context.getName() + " metaData=" + metaData);
-
- List<ContextInfo> contexts = metaData.getContexts();
- if (contexts == null)
- return;
-
- try
- {
- for (ContextInfo child : contexts)
- {
- // Only process the child contexts
- if ("".equals(child.getPath()) == false)
- {
- DeploymentContext childContext = createChildDeploymentContext(context, child);
- if (childContext == null)
- throw new IllegalStateException("Child deployment context is null");
-
- context.addChild(childContext);
- childContext.setParent(context);
-
- applyContextInfo(childContext, child);
-
- Attachments attachments = child.getPredeterminedManagedObjects();
- if (attachments != null)
- {
- StructureMetaData childStructure = attachments.getAttachment(StructureMetaData.class);
- if (childStructure != null)
- populateContext(childContext, childStructure);
- }
- }
- }
- }
- catch (Throwable t)
- {
- throw DeploymentException.rethrowAsDeploymentException("Error populating context " + context.getName(), t);
- }
- }
-
- /**
- * Apply the context info. This transfers the PredeterminedManagedObjects
- * and TransientManagedObjects and other information from the ContextInfo to the DeploymentContext.
- *
- * @param context the context
- * @param contextInfo the contextInfo
- * @throws Exception for any error
- */
- protected void applyContextInfo(DeploymentContext context, ContextInfo contextInfo) throws Exception
- {
- Attachments attachments = contextInfo.getPredeterminedManagedObjects();
- if (attachments != null)
- context.setPredeterminedManagedObjects(attachments);
-
- context.setRelativeOrder(contextInfo.getRelativeOrder());
- applyComparator(context, contextInfo);
- }
-
- /**
- * Try to apply the comparator
- *
- * @param context the context
- * @param contextInfo the contextInfo
- * @throws Exception for any error
- */
- @SuppressWarnings("unchecked")
- protected void applyComparator(DeploymentContext context, ContextInfo contextInfo) throws Exception
- {
- String className = contextInfo.getComparatorClassName();
- if (className == null)
- return;
- Object o = null;
- try
- {
- Class clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
- try
- {
- Field field = clazz.getField("INSTANCE");
- o = field.get(null);
- }
- catch (NoSuchFieldException ignored)
- {
- }
- if (o == null)
- o = clazz.newInstance();
- Comparator comparator = Comparator.class.cast(o);
- context.setComparator(comparator);
- }
- catch (Throwable t)
- {
- log.warn("Unable to load/set comparator: " + className);
- }
- }
-
- /**
- * Create the root deployment context
- *
- * @param deployment the deployment
- * @param metaData the structure meta data
- * @return the deployment context
- * @throws Exception for any error
- */
- protected DeploymentContext createRootDeploymentContext(Deployment deployment, StructureMetaData metaData) throws Exception
- {
- return createRootDeploymentContext(deployment);
- }
-
- /**
- * Create the root deployment context
- *
- * @param deployment the deployment
- * @return the deployment context
- * @throws Exception for any error
- */
- protected DeploymentContext createRootDeploymentContext(Deployment deployment) throws Exception
- {
- return new AbstractDeploymentContext(deployment.getName(), "");
- }
-
- /**
- * Create a child deployment context
- *
- * @param parent the parent deployment context
- * @param child the child context
- * @return the deployment context
- * @throws Exception for any error
- */
- protected DeploymentContext createChildDeploymentContext(DeploymentContext parent, ContextInfo child) throws Exception
- {
- String path = child.getPath();
- String name = parent.getName() + "/" + path;
- return new AbstractDeploymentContext(name, path);
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,311 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.deployers.structure.spi.helpers;
+
+import java.lang.reflect.Field;
+import java.util.Comparator;
+import java.util.List;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.DeploymentState;
+import org.jboss.deployers.spi.attachments.Attachments;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.spi.structure.StructureMetaDataFactory;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.structure.spi.StructureBuilder;
+import org.jboss.deployers.structure.spi.StructureProcessor;
+import org.jboss.logging.Logger;
+
+/**
+ * AbstractStructureBuilder.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractStructureBuilder implements StructureBuilder
+{
+ /** The log */
+ private final Logger log = Logger.getLogger(getClass());
+
+ /** The structure processor */
+ private StructureProcessor structureProcessor;
+
+ public DeploymentContext populateContext(Deployment deployment, StructureMetaData metaData) throws DeploymentException
+ {
+ if (deployment == null)
+ throw new IllegalArgumentException("Null deployment");
+ if (metaData == null)
+ throw new IllegalArgumentException("Null metaData");
+
+ boolean trace = log.isTraceEnabled();
+ if (trace)
+ log.trace("Populating deployment " + deployment.getName() + " metaData=" + metaData);
+
+ DeploymentContext result;
+ try
+ {
+ prepareStructureMetaData(deployment, metaData);
+
+ result = createRootDeploymentContext(deployment, metaData);
+ if (result == null)
+ throw new IllegalStateException("Root deployment context is null");
+ result.setDeployment(deployment);
+
+ ContextInfo contextInfo = metaData.getContext("");
+ if (contextInfo == null)
+ contextInfo = StructureMetaDataFactory.createContextInfo("", null);
+
+ applyStructureMetaData(result, metaData);
+ contextInfo.setPredeterminedManagedObjects(deployment.getPredeterminedManagedObjects());
+ applyContextInfo(result, contextInfo);
+ }
+ catch (Throwable t)
+ {
+ throw DeploymentException.rethrowAsDeploymentException("Error populating deployment " + deployment.getName(), t);
+ }
+
+ try
+ {
+ result.getTransientManagedObjects().addAttachment(StructureMetaData.class, metaData);
+ populateContext(result, metaData);
+ }
+ catch (Throwable t)
+ {
+ result.setProblem(t);
+ result.setState(DeploymentState.ERROR);
+ log.warn("Error populating deployment " + deployment.getName(), t);
+ }
+ return result;
+ }
+
+ /**
+ * Populate the child deployment contexts
+ *
+ * @param context the context
+ * @param metaData the metadata
+ * @throws Exception for any error
+ */
+ protected void populateContext(DeploymentContext context, StructureMetaData metaData) throws Exception
+ {
+ if (context == null)
+ throw new IllegalArgumentException("Null context");
+ if (metaData == null)
+ throw new IllegalArgumentException("Null metaData");
+
+ boolean trace = log.isTraceEnabled();
+ if (trace)
+ log.trace("Populating Context " + context.getName() + " metaData=" + metaData);
+
+ List<ContextInfo> contexts = metaData.getContexts();
+ if (contexts == null)
+ return;
+
+ try
+ {
+ for (ContextInfo child : contexts)
+ {
+ // Only process the child contexts
+ if ("".equals(child.getPath()) == false)
+ {
+ prepareContextInfo(context, child);
+
+ DeploymentContext childContext = createChildDeploymentContext(context, child);
+ if (childContext == null)
+ throw new IllegalStateException("Child deployment context is null");
+
+ context.addChild(childContext);
+ childContext.setParent(context);
+
+ applyContextInfo(childContext, child);
+
+ Attachments attachments = child.getPredeterminedManagedObjects();
+ if (attachments != null)
+ {
+ StructureMetaData childStructure = attachments.getAttachment(StructureMetaData.class);
+ if (childStructure != null)
+ populateContext(childContext, childStructure);
+ }
+ }
+ }
+ }
+ catch (Throwable t)
+ {
+ throw DeploymentException.rethrowAsDeploymentException("Error populating context " + context.getName(), t);
+ }
+ }
+
+ /**
+ * Prepare the structure metadata.
+ *
+ * @param deploymentContext the deployment
+ * @param structureMetaData the structure metadata
+ */
+ protected void prepareStructureMetaData(Deployment deploymentContext, StructureMetaData structureMetaData)
+ {
+ if (structureProcessor != null)
+ structureProcessor.prepareStructureMetaData(deploymentContext, structureMetaData);
+ }
+
+ /**
+ * Prepare the structure metadata.
+ *
+ * @param parentDeploymentContext the parent deployment context
+ * @param contextInfo the context info
+ */
+ protected void prepareContextInfo(DeploymentContext parentDeploymentContext, ContextInfo contextInfo)
+ {
+ if (structureProcessor != null)
+ structureProcessor.prepareContextInfo(parentDeploymentContext, contextInfo);
+ }
+
+ /**
+ * Apply the structure metadata.
+ *
+ * @param deploymentContext the parent deployment context
+ * @param structureMetaData the structure metadata
+ */
+ protected void applyStructureMetaData(DeploymentContext deploymentContext, StructureMetaData structureMetaData)
+ {
+ if (structureProcessor != null)
+ structureProcessor.applyStructureMetaData(deploymentContext, structureMetaData);
+ }
+
+ /**
+ * Apply the context info. This transfers the PredeterminedManagedObjects
+ * and TransientManagedObjects and other information from the ContextInfo to the DeploymentContext.
+ *
+ * @param context the context
+ * @param contextInfo the contextInfo
+ * @throws Exception for any error
+ */
+ protected void applyContextInfo(DeploymentContext context, ContextInfo contextInfo) throws Exception
+ {
+ Attachments attachments = contextInfo.getPredeterminedManagedObjects();
+ if (attachments != null)
+ context.setPredeterminedManagedObjects(attachments);
+
+ context.setRelativeOrder(contextInfo.getRelativeOrder());
+ applyComparator(context, contextInfo);
+
+ if (structureProcessor != null)
+ structureProcessor.applyContextInfo(context, contextInfo);
+ }
+
+ /**
+ * Try to apply the comparator
+ *
+ * @param context the context
+ * @param contextInfo the contextInfo
+ * @throws Exception for any error
+ */
+ @SuppressWarnings("unchecked")
+ protected void applyComparator(DeploymentContext context, ContextInfo contextInfo) throws Exception
+ {
+ String className = contextInfo.getComparatorClassName();
+ if (className == null)
+ return;
+ Object o = null;
+ try
+ {
+ Class clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
+ try
+ {
+ Field field = clazz.getField("INSTANCE");
+ o = field.get(null);
+ }
+ catch (NoSuchFieldException ignored)
+ {
+ }
+ if (o == null)
+ o = clazz.newInstance();
+ Comparator comparator = Comparator.class.cast(o);
+ context.setComparator(comparator);
+ }
+ catch (Throwable t)
+ {
+ log.warn("Unable to load/set comparator: " + className);
+ }
+ }
+
+ /**
+ * Create the root deployment context
+ *
+ * @param deployment the deployment
+ * @param metaData the structure meta data
+ * @return the deployment context
+ * @throws Exception for any error
+ */
+ protected DeploymentContext createRootDeploymentContext(Deployment deployment, StructureMetaData metaData) throws Exception
+ {
+ return createRootDeploymentContext(deployment);
+ }
+
+ /**
+ * Create the root deployment context
+ *
+ * @param deployment the deployment
+ * @return the deployment context
+ * @throws Exception for any error
+ */
+ protected DeploymentContext createRootDeploymentContext(Deployment deployment) throws Exception
+ {
+ return new AbstractDeploymentContext(deployment.getName(), "");
+ }
+
+ /**
+ * Create a child deployment context
+ *
+ * @param parent the parent deployment context
+ * @param child the child context
+ * @return the deployment context
+ * @throws Exception for any error
+ */
+ protected DeploymentContext createChildDeploymentContext(DeploymentContext parent, ContextInfo child) throws Exception
+ {
+ String path = child.getPath();
+ String name = parent.getName() + "/" + path;
+ return new AbstractDeploymentContext(name, path);
+ }
+
+ /**
+ * Set structure processor.
+ *
+ * @param structureProcessor the context info processor
+ */
+ public void setStructureProcessor(StructureProcessor structureProcessor)
+ {
+ this.structureProcessor = structureProcessor;
+ }
+
+ /**
+ * Get the context info processor.
+ *
+ * @return the structure processor
+ */
+ protected StructureProcessor getStructureProcessor()
+ {
+ return structureProcessor;
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/pom.xml 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,166 +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.deployers</groupId>
- <artifactId>jboss-deployers</artifactId>
- <version>2.0.4-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-deployers-vfs</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Deployers VFS</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Deployers VFS</description>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <!--configuration>
- <testFailureIgnore>true</testFailureIgnore>
- </configuration-->
- </plugin>
- </plugins>
- </build>
-
- <!-- Do not add version information here, use ../pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.cl</groupId>
- <artifactId>jboss-classloading-vfs</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.cl</groupId>
- <artifactId>jboss-classloading</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-impl</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.cl</groupId>
- <artifactId>jboss-classloading</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- Test dependencies -->
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-structure-spi</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-impl</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.cl</groupId>
- <artifactId>jboss-classloading</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <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/jboss-deployers/tags/2.0.4.GA/deployers-vfs/pom.xml (from rev 83489, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/pom.xml)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/pom.xml (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,166 @@
+<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.deployers</groupId>
+ <artifactId>jboss-deployers</artifactId>
+ <version>2.0.4.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Deployers VFS</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Deployers VFS</description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <!--configuration>
+ <testFailureIgnore>true</testFailureIgnore>
+ </configuration-->
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- Do not add version information here, use ../pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cl</groupId>
+ <artifactId>jboss-classloading-vfs</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.cl</groupId>
+ <artifactId>jboss-classloading</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-impl</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.cl</groupId>
+ <artifactId>jboss-classloading</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-structure-spi</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-impl</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.cl</groupId>
+ <artifactId>jboss-classloading</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <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/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,135 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, 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.deployers.vfs.plugins.classloader;
-
-import java.net.URL;
-import java.util.List;
-
-import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.util.id.GUID;
-import org.jboss.virtual.MemoryFileFactory;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * TempURLDeployer.
- *
- * @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 $
- */
-public class InMemoryClassesDeployer extends AbstractVFSRealDeployer
-{
- /** The name of the dynamic class root */
- public static final String DYNAMIC_CLASS_URL_KEY = "DYNAMIC_CLASS_URL_KEY";
-
- /** The name of the dynamic class root */
- public static final String DYNAMIC_CLASS_KEY = "DYNAMIC_CLASS_KEY";
-
- /** The host name creator */
- private HostNameCreator hostNameCreator;
-
- /**
- * Create a new TempURLDeployer.
- */
- public InMemoryClassesDeployer()
- {
- // Make it run before the classloader describe deployer
- setStage(DeploymentStages.DESCRIBE);
- setOutput(ClassLoadingMetaData.class);
- setTopLevelOnly(true);
- }
-
- /**
- * Create host name.
- *
- * @param unit the deployment unit
- * @return the host name
- */
- protected String createHost(VFSDeploymentUnit unit)
- {
- return (hostNameCreator != null) ? hostNameCreator.createHostName(unit) : GUID.asString();
- }
-
- @Override
- public void deploy(VFSDeploymentUnit unit) throws DeploymentException
- {
- try
- {
- URL dynamicClassRoot = new URL("vfsmemory", createHost(unit), "");
- VirtualFile classes = MemoryFileFactory.createRoot(dynamicClassRoot).getRoot();
- unit.addAttachment(DYNAMIC_CLASS_URL_KEY, dynamicClassRoot);
- unit.addAttachment(DYNAMIC_CLASS_KEY, classes);
- unit.prependClassPath(classes);
- log.debug("Dynamic class root for " + unit.getName() + " is " + dynamicClassRoot);
- }
- catch (Exception e)
- {
- throw new DeploymentException("Error creating dynamic class root", e);
- }
- }
-
- @Override
- public void undeploy(VFSDeploymentUnit unit)
- {
- log.debug("Removing dynamic class root for " + unit.getName());
- try
- {
- VirtualFile classes = unit.removeAttachment(DYNAMIC_CLASS_KEY, VirtualFile.class);
- if (classes != null)
- {
- List<VirtualFile> classPath = unit.getClassPath();
- if (classPath != null)
- {
- classPath.remove(classes);
- unit.setClassPath(classPath);
- }
- }
- }
- finally
- {
- try
- {
- URL root = unit.removeAttachment(DYNAMIC_CLASS_URL_KEY, URL.class);
- if (root != null)
- MemoryFileFactory.deleteRoot(root);
- }
- catch (Exception e)
- {
- log.warn("Error deleting dynamic class root for " + unit.getName(), e);
- }
- }
- }
-
- /**
- * Set host name creator.
- *
- * @param hostNameCreator the host name creator
- */
- public void setHostNameCreator(HostNameCreator hostNameCreator)
- {
- this.hostNameCreator = hostNameCreator;
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,129 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, 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.deployers.vfs.plugins.classloader;
+
+import java.net.URL;
+
+import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.util.id.GUID;
+import org.jboss.virtual.MemoryFileFactory;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * TempURLDeployer.
+ *
+ * @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 $
+ */
+public class InMemoryClassesDeployer extends AbstractVFSRealDeployer
+{
+ /** The name of the dynamic class root */
+ public static final String DYNAMIC_CLASS_URL_KEY = "DYNAMIC_CLASS_URL_KEY";
+
+ /** The name of the dynamic class root */
+ public static final String DYNAMIC_CLASS_KEY = "DYNAMIC_CLASS_KEY";
+
+ /** The host name creator */
+ private HostNameCreator hostNameCreator;
+
+ /**
+ * Create a new TempURLDeployer.
+ */
+ public InMemoryClassesDeployer()
+ {
+ // Make it run before the classloader describe deployer
+ setStage(DeploymentStages.DESCRIBE);
+ setOutput(ClassLoadingMetaData.class);
+ setTopLevelOnly(true);
+ }
+
+ /**
+ * Create host name.
+ *
+ * @param unit the deployment unit
+ * @return the host name
+ */
+ protected String createHost(VFSDeploymentUnit unit)
+ {
+ return (hostNameCreator != null) ? hostNameCreator.createHostName(unit) : GUID.asString();
+ }
+
+ @Override
+ public void deploy(VFSDeploymentUnit unit) throws DeploymentException
+ {
+ try
+ {
+ URL dynamicClassRoot = new URL("vfsmemory", createHost(unit), "");
+ VirtualFile classes = MemoryFileFactory.createRoot(dynamicClassRoot).getRoot();
+ unit.addAttachment(DYNAMIC_CLASS_URL_KEY, dynamicClassRoot);
+ unit.addAttachment(DYNAMIC_CLASS_KEY, classes);
+ unit.prependClassPath(classes);
+ log.debug("Dynamic class root for " + unit.getName() + " is " + dynamicClassRoot);
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Error creating dynamic class root", e);
+ }
+ }
+
+ @Override
+ public void undeploy(VFSDeploymentUnit unit)
+ {
+ log.debug("Removing dynamic class root for " + unit.getName());
+ try
+ {
+ VirtualFile classes = unit.removeAttachment(DYNAMIC_CLASS_KEY, VirtualFile.class);
+ if (classes != null)
+ {
+ unit.removeClassPath(classes);
+ }
+ }
+ finally
+ {
+ try
+ {
+ URL root = unit.removeAttachment(DYNAMIC_CLASS_URL_KEY, URL.class);
+ if (root != null)
+ MemoryFileFactory.deleteRoot(root);
+ }
+ catch (Exception e)
+ {
+ log.warn("Error deleting dynamic class root for " + unit.getName(), e);
+ }
+ }
+ }
+
+ /**
+ * Set host name creator.
+ *
+ * @param hostNameCreator the host name creator
+ */
+ public void setHostNameCreator(HostNameCreator hostNameCreator)
+ {
+ this.hostNameCreator = hostNameCreator;
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,197 +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.deployers.vfs.plugins.classloader;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import java.security.ProtectionDomain;
-import java.security.CodeSource;
-
-import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.vfs.spi.deployer.AbstractOptionalVFSRealDeployer;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * Integration deployer.
- * Adds integration path to deployment classpath.
- *
- * @param <T> exact output type
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- */
-public abstract class UrlIntegrationDeployer<T> extends AbstractOptionalVFSRealDeployer<T>
-{
- /** Location of integration jar */
- private Set<URL> integrationURLs;
-
- public UrlIntegrationDeployer(Class<T> input)
- {
- super(input);
- // We have to run before the classloading is setup
- setStage(DeploymentStages.DESCRIBE);
- // Keep things simple having one attachment to control the classloader processing order
- setOutput(ClassLoadingMetaData.class);
- }
-
- /**
- * Get the integration url.
- *
- * @return the integration url
- */
- public URL getIntegrationURL()
- {
- if (integrationURLs == null || integrationURLs.isEmpty())
- return null;
- else if (integrationURLs.size() == 1)
- return integrationURLs.iterator().next();
- else
- throw new IllegalArgumentException("Multiple integration urls: " + integrationURLs);
- }
-
- /**
- * Set integration url.
- *
- * @param url the integration url
- */
- public void setIntegrationURL(URL url)
- {
- integrationURLs = Collections.singleton(url);
- }
-
- /**
- * Get integration urls.
- *
- * @return the integration urls
- */
- public Set<URL> getIntegrationURLs()
- {
- return integrationURLs;
- }
-
- /**
- * Set integration urls.
- *
- * @param integrationURLs the integration urls
- */
- public void setIntegrationURLs(Set<URL> integrationURLs)
- {
- this.integrationURLs = integrationURLs;
- }
-
- /**
- * Check if integration urls exist.
- */
- public void start()
- {
- if (integrationURLs == null || integrationURLs.isEmpty())
- throw new IllegalArgumentException("No integration urls.");
- }
-
- @Override
- public void deploy(VFSDeploymentUnit unit, T metaData) throws DeploymentException
- {
- if (isIntegrationDeployment(unit, metaData))
- {
- List<VirtualFile> added = new ArrayList<VirtualFile>();
- try
- {
- for (URL integrationURL : integrationURLs)
- {
- VirtualFile integration = VFS.getCachedFile(integrationURL);
- unit.addClassPath(integration);
- added.add(integration);
- }
- }
- catch (Throwable t)
- {
- List<VirtualFile> classPath = unit.getClassPath();
- for (int i = added.size() - 1; i >=0; i--)
- {
- classPath.remove(added.get(i));
- }
- throw DeploymentException.rethrowAsDeploymentException("Error adding integration path.", t);
- }
- }
- }
-
- @Override
- public void undeploy(VFSDeploymentUnit unit, T metaData)
- {
- if (isIntegrationDeployment(unit, metaData))
- {
- List<VirtualFile> classPath = unit.getClassPath();
- for (URL integrationURL : integrationURLs)
- {
- try
- {
- VirtualFile integration = VFS.getCachedFile(integrationURL);
- classPath.remove(integration);
- }
- catch (Throwable t)
- {
- log.warn("Error removing integration from classpath: " + integrationURL, t);
- }
- }
- }
- }
-
- /**
- * Get the deployer's location.
- * Might be useful for integration url creation.
- *
- * @return the deployer's location
- */
- protected String getDeployerLocation()
- {
- ProtectionDomain pd = getClass().getProtectionDomain();
- CodeSource cs = pd.getCodeSource();
- URL location = cs.getLocation();
- return location.toExternalForm();
- }
-
- /**
- * Is unit integration deployment unit?
- *
- * @param unit the deployment unit
- * @param metaData the meta data
- * @return true if the unit is integration deployment
- */
- protected boolean isIntegrationDeployment(VFSDeploymentUnit unit, T metaData)
- {
- return isIntegrationDeployment(unit);
- }
-
- /**
- * Is unit integration deployment unit?
- *
- * @param unit the deployment unit
- * @return true if the unit is integration deployment
- */
- protected abstract boolean isIntegrationDeployment(VFSDeploymentUnit unit);
-}
\ No newline at end of file
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,197 @@
+/*
+* 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.deployers.vfs.plugins.classloader;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.security.ProtectionDomain;
+import java.security.CodeSource;
+
+import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.vfs.spi.deployer.AbstractOptionalVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Integration deployer.
+ * Adds integration path to deployment classpath.
+ *
+ * @param <T> exact output type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class UrlIntegrationDeployer<T> extends AbstractOptionalVFSRealDeployer<T>
+{
+ /** Location of integration jar */
+ private Set<URL> integrationURLs;
+
+ public UrlIntegrationDeployer(Class<T> input)
+ {
+ super(input);
+ // We have to run before the classloading is setup
+ setStage(DeploymentStages.DESCRIBE);
+ // Keep things simple having one attachment to control the classloader processing order
+ setOutput(ClassLoadingMetaData.class);
+ }
+
+ /**
+ * Get the integration url.
+ *
+ * @return the integration url
+ */
+ public URL getIntegrationURL()
+ {
+ if (integrationURLs == null || integrationURLs.isEmpty())
+ return null;
+ else if (integrationURLs.size() == 1)
+ return integrationURLs.iterator().next();
+ else
+ throw new IllegalArgumentException("Multiple integration urls: " + integrationURLs);
+ }
+
+ /**
+ * Set integration url.
+ *
+ * @param url the integration url
+ */
+ public void setIntegrationURL(URL url)
+ {
+ integrationURLs = Collections.singleton(url);
+ }
+
+ /**
+ * Get integration urls.
+ *
+ * @return the integration urls
+ */
+ public Set<URL> getIntegrationURLs()
+ {
+ return integrationURLs;
+ }
+
+ /**
+ * Set integration urls.
+ *
+ * @param integrationURLs the integration urls
+ */
+ public void setIntegrationURLs(Set<URL> integrationURLs)
+ {
+ this.integrationURLs = integrationURLs;
+ }
+
+ /**
+ * Check if integration urls exist.
+ */
+ public void start()
+ {
+ if (integrationURLs == null || integrationURLs.isEmpty())
+ throw new IllegalArgumentException("No integration urls.");
+ }
+
+ @Override
+ public void deploy(VFSDeploymentUnit unit, T metaData) throws DeploymentException
+ {
+ if (isIntegrationDeployment(unit, metaData))
+ {
+ List<VirtualFile> added = new ArrayList<VirtualFile>();
+ try
+ {
+ for (URL integrationURL : integrationURLs)
+ {
+ VirtualFile integration = VFS.getRoot(integrationURL);
+ unit.addClassPath(integration);
+ added.add(integration);
+ }
+ }
+ catch (Throwable t)
+ {
+ List<VirtualFile> classPath = unit.getClassPath();
+ for (int i = added.size() - 1; i >=0; i--)
+ {
+ classPath.remove(added.get(i));
+ }
+ throw DeploymentException.rethrowAsDeploymentException("Error adding integration path.", t);
+ }
+ }
+ }
+
+ @Override
+ public void undeploy(VFSDeploymentUnit unit, T metaData)
+ {
+ if (isIntegrationDeployment(unit, metaData))
+ {
+ List<VirtualFile> classPath = unit.getClassPath();
+ for (URL integrationURL : integrationURLs)
+ {
+ try
+ {
+ VirtualFile integration = VFS.getRoot(integrationURL);
+ classPath.remove(integration);
+ }
+ catch (Throwable t)
+ {
+ log.warn("Error removing integration from classpath: " + integrationURL, t);
+ }
+ }
+ }
+ }
+
+ /**
+ * Get the deployer's location.
+ * Might be useful for integration url creation.
+ *
+ * @return the deployer's location
+ */
+ protected String getDeployerLocation()
+ {
+ ProtectionDomain pd = getClass().getProtectionDomain();
+ CodeSource cs = pd.getCodeSource();
+ URL location = cs.getLocation();
+ return location.toExternalForm();
+ }
+
+ /**
+ * Is unit integration deployment unit?
+ *
+ * @param unit the deployment unit
+ * @param metaData the meta data
+ * @return true if the unit is integration deployment
+ */
+ protected boolean isIntegrationDeployment(VFSDeploymentUnit unit, T metaData)
+ {
+ return isIntegrationDeployment(unit);
+ }
+
+ /**
+ * Is unit integration deployment unit?
+ *
+ * @param unit the deployment unit
+ * @return true if the unit is integration deployment
+ */
+ protected abstract boolean isIntegrationDeployment(VFSDeploymentUnit unit);
+}
\ No newline at end of file
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,53 +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.deployers.vfs.plugins.dependency;
-
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-
-/**
- * DependenciesMetaDataDeployer.
- *
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class DependenciesMetaDataDeployer extends AbstractSimpleRealDeployer<DependenciesMetaData>
-{
- public DependenciesMetaDataDeployer()
- {
- super(DependenciesMetaData.class);
- addOutput(DeploymentDependencies.class);
- setStage(DeploymentStages.POST_PARSE);
- }
-
- public void deploy(DeploymentUnit unit, DependenciesMetaData deployment) throws DeploymentException
- {
- ControllerContext context = unit.getTopLevel().getAttachment(ControllerContext.class);
- if (context == null)
- throw new DeploymentException("Missing deployment controller context: " + unit.getName());
-
- Object contextName = context.getName();
- unit.addAttachment(DeploymentDependencies.class, new DeploymentDependenciesImpl(contextName, deployment));
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,53 @@
+/*
+ * 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.deployers.vfs.plugins.dependency;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * DependenciesMetaDataDeployer.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class DependenciesMetaDataDeployer extends AbstractSimpleRealDeployer<DependenciesMetaData>
+{
+ public DependenciesMetaDataDeployer()
+ {
+ super(DependenciesMetaData.class);
+ addOutput(DeploymentDependencies.class);
+ setStage(DeploymentStages.POST_PARSE);
+ }
+
+ public void deploy(DeploymentUnit unit, DependenciesMetaData deployment) throws DeploymentException
+ {
+ ControllerContext context = unit.getTopLevel().getAttachment(ControllerContext.class);
+ if (context == null)
+ throw new DeploymentException("Missing deployment controller context: " + unit.getName());
+
+ Object contextName = context.getName();
+ unit.addAttachment(DeploymentDependencies.class, new DeploymentDependenciesImpl(contextName, deployment));
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,408 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, 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.deployers.vfs.plugins.structure;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Arrays;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentResourceLoader;
-import org.jboss.logging.Logger;
-import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * AbstractVFSDeploymentContext.
- *
- * @author <a href="adrian at jboss.org">Adrian Brock</a>
- * @author <a href="ales.justin at jboss.org">Ales Justin</a>
- * @version $Revision: 1.1 $
- */
-public class AbstractVFSDeploymentContext extends AbstractDeploymentContext implements VFSDeploymentContext, AbstractVFSDeploymentContextMBean
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = 4474515937180482776L;
-
- /** The log */
- private static final Logger log = Logger.getLogger(AbstractVFSDeploymentContext.class);
-
- /** The root virtual file */
- private VirtualFile root;
-
- /** The meta data locations */
- private List<VirtualFile> metaDataLocations;
-
- /** The class paths */
- private List<VirtualFile> classPath;
-
- /** The loader */
- private transient VFSDeploymentResourceLoader loader;
-
- /**
- * Get the vfs file name safely
- *
- * @param root the virutal file
- * @return the name
- */
- static final String safeVirtualFileName(VirtualFile root)
- {
- if (root == null)
- throw new IllegalArgumentException("Null root");
- try
- {
- return root.toURI().toString();
- }
- catch (Exception e)
- {
- return root.getName();
- }
- }
-
- /**
- * For serialization
- */
- public AbstractVFSDeploymentContext()
- {
- }
-
- /**
- * Create a new AbstractVFSDeploymentContext.
- *
- * @param name the name
- * @param simpleName the simple name
- * @param root the virtual file
- * @param relativePath the relative path
- */
- public AbstractVFSDeploymentContext(String name, String simpleName, VirtualFile root, String relativePath)
- {
- super(name, simpleName, relativePath);
- this.root = root;
- }
-
- /**
- * Create a new AbstractVFSDeploymentContext.
- *
- * @param root the virtual file
- * @param relativePath the relative path
- */
- public AbstractVFSDeploymentContext(VirtualFile root, String relativePath)
- {
- super(safeVirtualFileName(root), root.getName(), relativePath);
- this.root = root;
- }
-
- public VirtualFile getRoot()
- {
- return root;
- }
-
- public void setMetaDataPath(List<String> paths)
- {
- if (paths == null)
- {
- setMetaDataLocations(null);
- return;
- }
-
- try
- {
- List<VirtualFile> locations = new ArrayList<VirtualFile>();
- for (String path : paths)
- {
- if (path == null)
- throw new IllegalArgumentException("Null path in paths: " + paths);
-
- VirtualFile child = root.getChild(path);
- if (child != null)
- locations.add(child);
- else
- log.debug("Meta data path does not exist: root=" + root.getPathName() + " path=" + path);
- }
- setMetaDataLocations(locations);
- }
- catch (IOException e)
- {
- log.warn("Exception while applying paths: root=" + root.getPathName() + " paths=" + paths);
- }
- }
-
- public List<VirtualFile> getMetaDataLocations()
- {
- if (metaDataLocations == null)
- return Collections.emptyList();
-
- return metaDataLocations;
- }
-
- public void setMetaDataLocations(List<VirtualFile> locations)
- {
- this.metaDataLocations = locations;
- }
-
- public VirtualFile getMetaDataFile(String name)
- {
- if (name == null)
- throw new IllegalArgumentException("Null name");
- try
- {
- // There isn't a metadata locations so let's see whether the root matches.
- if (metaDataLocations == null || metaDataLocations.isEmpty())
- {
- // It has to be a plain file
- if (root != null && SecurityActions.isLeaf(root))
- {
- String fileName = root.getName();
- if (fileName.equals(name))
- return root;
- }
-
- // No match
- return null;
- }
- // Look in the meta data locations
- return searchMetaDataLocations(name);
- }
- catch (Exception e)
- {
- if (log.isTraceEnabled())
- log.trace("Error retrieving meta data: " + name + " reason=" + e);
- return null;
- }
- }
-
- /**
- * Search the metadata locations.
- * In this impl the first one matching is returned.
- *
- * @param name the file name to find
- * @return found file or null if not found
- */
- protected VirtualFile searchMetaDataLocations(String name)
- {
- VirtualFile result = null;
- for(VirtualFile location : getMetaDataLocations())
- {
- try
- {
- result = location.getChild(name);
- if (result != null)
- {
- if (log.isTraceEnabled())
- log.trace("Found " + name + " in " + location.getName());
- deployed();
- break;
- }
- }
- catch (IOException e)
- {
- log.debug("Search exception invocation for metafile " + name + " in " + location.getName() + ", reason: " + e);
- }
- }
- return result;
- }
-
- public List<VirtualFile> getMetaDataFiles(String name, String suffix)
- {
- if (name == null && suffix == null)
- throw new IllegalArgumentException("Null name and suffix");
- try
- {
- // There isn't a metadata location so let's see whether the root matches.
- // i.e. the top level is an xml
- if (metaDataLocations == null || metaDataLocations.isEmpty())
- {
- // It has to be a plain file
- if (root != null && SecurityActions.isLeaf(root))
- {
- String fileName = root.getName();
- if (name != null && fileName.equals(name))
- return Collections.singletonList(root);
- if (suffix != null && fileName.endsWith(suffix))
- return Collections.singletonList(root);
- }
-
- // No match
- return Collections.emptyList();
- }
- // Look in the meta data location
- List<VirtualFile> results = new ArrayList<VirtualFile>();
- for (VirtualFile location : metaDataLocations)
- {
- List<VirtualFile> result = location.getChildren(new MetaDataMatchFilter(name, suffix));
- if (result != null && result.isEmpty() == false)
- {
- if (log.isTraceEnabled())
- log.trace("Found name=" + name + ", suffix=" + suffix + " in " + location.getName());
- results.addAll(result);
- deployed();
- }
- }
- return results;
- }
- catch (Exception e)
- {
- log.debug("Error retrieving meta data: name=" + name + " suffix=" + suffix, e);
- return Collections.emptyList();
- }
- }
-
- public VirtualFile getFile(String name)
- {
- return getResourceLoader().getFile(name);
- }
-
- public List<VirtualFile> getClassPath()
- {
- return classPath;
- }
-
- public void setClassPath(List<VirtualFile> paths)
- {
- this.classPath = paths;
- if (log.isTraceEnabled() && paths != null)
- log.trace("ClassPath for " + root.getPathName() + " is " + VFSUtils.getPathsString(paths));
- }
-
- public void appendClassPath(List<VirtualFile> files)
- {
- if (files == null)
- throw new IllegalArgumentException("Null files");
-
- List<VirtualFile> classPath = getClassPath();
- if (classPath == null)
- classPath = new ArrayList<VirtualFile>();
-
- for (VirtualFile file : files)
- {
- if (file == null)
- throw new IllegalArgumentException("Null virtual file in " + files);
- classPath.add(file);
- }
- setClassPath(classPath);
- }
-
- public void prependClassPath(VirtualFile... files)
- {
- if (files == null)
- throw new IllegalArgumentException("Null files");
-
- List<VirtualFile> classPath = getClassPath();
- if (classPath == null)
- classPath = new ArrayList<VirtualFile>();
-
- for (int i = files.length-1; i >= 0; --i)
- {
- VirtualFile file = files[i];
- if (file == null)
- throw new IllegalArgumentException("Null virtual file in " + Arrays.toString(files));
- classPath.add(0, file);
- }
- setClassPath(classPath);
- }
-
- public void prependClassPath(List<VirtualFile> files)
- {
- if (files == null)
- throw new IllegalArgumentException("Null files");
-
- List<VirtualFile> classPath = getClassPath();
- if (classPath == null)
- classPath = new ArrayList<VirtualFile>();
-
- for (int i = files.size()-1; i >= 0; --i)
- {
- VirtualFile file = files.get(i);
- if (file == null)
- throw new IllegalArgumentException("Null virtual file in " + files);
- classPath.add(0, file);
- }
- setClassPath(classPath);
- }
-
- public void appendClassPath(VirtualFile... files)
- {
- if (files == null)
- throw new IllegalArgumentException("Null files");
-
- List<VirtualFile> classPath = getClassPath();
- if (classPath == null)
- classPath = new ArrayList<VirtualFile>();
-
- for (VirtualFile file : files)
- {
- if (file == null)
- throw new IllegalArgumentException("Null virtual file in " + Arrays.toString(files));
- classPath.add(file);
- }
- setClassPath(classPath);
- }
-
- @Override
- public VFSDeploymentContext getTopLevel()
- {
- return (VFSDeploymentContext) super.getTopLevel();
- }
-
- @Override
- public VFSDeploymentResourceLoader getResourceLoader()
- {
- if (loader != null)
- return loader;
-
- loader = new VFSDeploymentResourceLoaderImpl(getRoot());
- return loader;
- }
-
- protected DeploymentUnit createDeploymentUnit()
- {
- return new AbstractVFSDeploymentUnit(this);
- }
-
- @SuppressWarnings("unchecked")
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- {
- super.readExternal(in);
- root = (VirtualFile) in.readObject();
- boolean isNullOrEmpty = in.readBoolean();
- if (isNullOrEmpty == false)
- metaDataLocations = (List<VirtualFile>) in.readObject();
- classPath = (List) in.readObject();
- }
-
- public void writeExternal(ObjectOutput out) throws IOException
- {
- super.writeExternal(out);
- out.writeObject(root);
- boolean isNullOrEmpty = metaDataLocations == null || metaDataLocations.isEmpty();
- out.writeBoolean(isNullOrEmpty);
- if (isNullOrEmpty == false)
- out.writeObject(metaDataLocations);
- out.writeObject(classPath);
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,511 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.deployers.vfs.plugins.structure;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentResourceLoader;
+import org.jboss.logging.Logger;
+import org.jboss.virtual.VFSUtils;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * AbstractVFSDeploymentContext.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractVFSDeploymentContext extends AbstractDeploymentContext implements VFSDeploymentContext, AbstractVFSDeploymentContextMBean
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 4474515937180482776L;
+
+ /** The log */
+ private static final Logger log = Logger.getLogger(AbstractVFSDeploymentContext.class);
+
+ /** The root virtual file */
+ private VirtualFile root;
+
+ /** The meta data locations */
+ private List<VirtualFile> metaDataLocations;
+
+ /** The class paths */
+ private List<VirtualFile> classPath;
+
+ /** The loader */
+ private transient VFSDeploymentResourceLoader loader;
+
+ /**
+ * Get the vfs file name safely
+ *
+ * @param root the virutal file
+ * @return the name
+ */
+ static final String safeVirtualFileName(VirtualFile root)
+ {
+ if (root == null)
+ throw new IllegalArgumentException("Null root");
+ try
+ {
+ return root.toURI().toString();
+ }
+ catch (Exception e)
+ {
+ return root.getName();
+ }
+ }
+
+ /**
+ * For serialization
+ */
+ public AbstractVFSDeploymentContext()
+ {
+ }
+
+ /**
+ * Create a new AbstractVFSDeploymentContext.
+ *
+ * @param name the name
+ * @param simpleName the simple name
+ * @param root the virtual file
+ * @param relativePath the relative path
+ */
+ public AbstractVFSDeploymentContext(String name, String simpleName, VirtualFile root, String relativePath)
+ {
+ super(name, simpleName, relativePath);
+ this.root = root;
+ }
+
+ /**
+ * Create a new AbstractVFSDeploymentContext.
+ *
+ * @param root the virtual file
+ * @param relativePath the relative path
+ */
+ public AbstractVFSDeploymentContext(VirtualFile root, String relativePath)
+ {
+ super(safeVirtualFileName(root), root.getName(), relativePath);
+ this.root = root;
+ }
+
+ public VirtualFile getRoot()
+ {
+ return root;
+ }
+
+ public void setMetaDataPath(List<String> paths)
+ {
+ if (paths == null)
+ {
+ setMetaDataLocations(null);
+ return;
+ }
+
+ try
+ {
+ List<VirtualFile> locations = new ArrayList<VirtualFile>();
+ for (String path : paths)
+ {
+ if (path == null)
+ throw new IllegalArgumentException("Null path in paths: " + paths);
+
+ VirtualFile child = root.getChild(path);
+ if (child != null)
+ locations.add(child);
+ else
+ log.debug("Meta data path does not exist: root=" + root.getPathName() + " path=" + path);
+ }
+ setMetaDataLocations(locations);
+ }
+ catch (IOException e)
+ {
+ log.warn("Exception while applying paths: root=" + root.getPathName() + " paths=" + paths);
+ }
+ }
+
+ /**
+ * Get mutable metadata locations.
+ *
+ * @return the mutable metadata locations
+ */
+ protected List<VirtualFile> getMutableMetaDataLocations()
+ {
+ return metaDataLocations;
+ }
+
+ public List<VirtualFile> getMetaDataLocations()
+ {
+ if (metaDataLocations == null || metaDataLocations.isEmpty())
+ {
+ return Collections.emptyList();
+ }
+ else
+ {
+ return Collections.unmodifiableList(metaDataLocations);
+ }
+ }
+
+ public void setMetaDataLocations(List<VirtualFile> locations)
+ {
+ this.metaDataLocations = locations;
+ }
+
+ public VirtualFile getMetaDataFile(String name)
+ {
+ if (name == null)
+ throw new IllegalArgumentException("Null name");
+ try
+ {
+ // There isn't a metadata locations so let's see whether the root matches.
+ if (metaDataLocations == null || metaDataLocations.isEmpty())
+ {
+ // It has to be a plain file
+ if (root != null && SecurityActions.isLeaf(root))
+ {
+ String fileName = root.getName();
+ if (fileName.equals(name))
+ return root;
+ }
+
+ // No match
+ return null;
+ }
+ // Look in the meta data locations
+ return searchMetaDataLocations(name);
+ }
+ catch (Exception e)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Error retrieving meta data: " + name + " reason=" + e);
+ return null;
+ }
+ }
+
+ /**
+ * Search the metadata locations.
+ * In this impl the first one matching is returned.
+ *
+ * @param name the file name to find
+ * @return found file or null if not found
+ */
+ protected VirtualFile searchMetaDataLocations(String name)
+ {
+ VirtualFile result = null;
+ for(VirtualFile location : getMetaDataLocations())
+ {
+ try
+ {
+ result = location.getChild(name);
+ if (result != null)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Found " + name + " in " + location.getName());
+ deployed();
+ break;
+ }
+ }
+ catch (IOException e)
+ {
+ log.debug("Search exception invocation for metafile " + name + " in " + location.getName() + ", reason: " + e);
+ }
+ }
+ return result;
+ }
+
+ public List<VirtualFile> getMetaDataFiles(String name, String suffix)
+ {
+ if (name == null && suffix == null)
+ throw new IllegalArgumentException("Null name and suffix");
+ try
+ {
+ // There isn't a metadata location so let's see whether the root matches.
+ // i.e. the top level is an xml
+ if (metaDataLocations == null || metaDataLocations.isEmpty())
+ {
+ // It has to be a plain file
+ if (root != null && SecurityActions.isLeaf(root))
+ {
+ String fileName = root.getName();
+ if (name != null && fileName.equals(name))
+ return Collections.singletonList(root);
+ if (suffix != null && fileName.endsWith(suffix))
+ return Collections.singletonList(root);
+ }
+
+ // No match
+ return Collections.emptyList();
+ }
+ // Look in the meta data location
+ List<VirtualFile> results = new ArrayList<VirtualFile>();
+ for (VirtualFile location : metaDataLocations)
+ {
+ List<VirtualFile> result = location.getChildren(new MetaDataMatchFilter(name, suffix));
+ if (result != null && result.isEmpty() == false)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Found name=" + name + ", suffix=" + suffix + " in " + location.getName());
+ results.addAll(result);
+ deployed();
+ }
+ }
+ return results;
+ }
+ catch (Exception e)
+ {
+ log.debug("Error retrieving meta data: name=" + name + " suffix=" + suffix, e);
+ return Collections.emptyList();
+ }
+ }
+
+ public void prependMetaDataLocation(VirtualFile... locations)
+ {
+ if (locations == null)
+ throw new IllegalArgumentException("Null locations");
+
+ List<VirtualFile> metadataLocations = getMutableMetaDataLocations();
+ if (metadataLocations == null)
+ metadataLocations = new ArrayList<VirtualFile>();
+
+ for (int i = locations.length-1; i >= 0; --i)
+ {
+ VirtualFile location = locations[i];
+ if (location == null)
+ throw new IllegalArgumentException("Null virtual file in " + Arrays.toString(locations));
+ metadataLocations.add(0, location);
+ }
+ setMetaDataLocations(metadataLocations);
+ }
+
+ public void appendMetaDataLocation(VirtualFile... locations)
+ {
+ if (locations == null)
+ throw new IllegalArgumentException("Null location");
+
+ List<VirtualFile> metaDataLocations = getMutableMetaDataLocations();
+ if (metaDataLocations == null)
+ metaDataLocations = new ArrayList<VirtualFile>();
+
+ for (VirtualFile location : locations)
+ {
+ if (location == null)
+ throw new IllegalArgumentException("Null virtual file in " + Arrays.toString(locations));
+ metaDataLocations.add(location);
+ }
+ setMetaDataLocations(metaDataLocations);
+ }
+
+ public void removeMetaDataLocation(VirtualFile... locations)
+ {
+ if (locations == null || locations.length == 0)
+ return;
+
+ for (VirtualFile location : locations)
+ {
+ metaDataLocations.remove(location);
+ }
+ }
+
+ public VirtualFile getFile(String name)
+ {
+ return getResourceLoader().getFile(name);
+ }
+
+ /**
+ * Get mutable classpath.
+ *
+ * @return the mutable classpath
+ */
+ protected List<VirtualFile> getMutableClassPath()
+ {
+ return classPath;
+ }
+
+ public List<VirtualFile> getClassPath()
+ {
+ if (classPath == null || classPath.isEmpty())
+ {
+ return Collections.emptyList();
+ }
+ else
+ {
+ return Collections.unmodifiableList(classPath);
+ }
+ }
+
+ public void setClassPath(List<VirtualFile> paths)
+ {
+ this.classPath = paths;
+ if (log.isTraceEnabled() && paths != null)
+ log.trace("ClassPath for " + root.getPathName() + " is " + VFSUtils.getPathsString(paths));
+ }
+
+ public void appendClassPath(List<VirtualFile> files)
+ {
+ if (files == null)
+ throw new IllegalArgumentException("Null files");
+
+ List<VirtualFile> classPath = getMutableClassPath();
+ if (classPath == null)
+ classPath = new ArrayList<VirtualFile>();
+
+ for (VirtualFile file : files)
+ {
+ if (file == null)
+ throw new IllegalArgumentException("Null virtual file in " + files);
+ classPath.add(file);
+ }
+ setClassPath(classPath);
+ }
+
+ public void prependClassPath(VirtualFile... files)
+ {
+ if (files == null)
+ throw new IllegalArgumentException("Null files");
+
+ List<VirtualFile> classPath = getMutableClassPath();
+ if (classPath == null)
+ classPath = new ArrayList<VirtualFile>();
+
+ for (int i = files.length-1; i >= 0; --i)
+ {
+ VirtualFile file = files[i];
+ if (file == null)
+ throw new IllegalArgumentException("Null virtual file in " + Arrays.toString(files));
+ classPath.add(0, file);
+ }
+ setClassPath(classPath);
+ }
+
+ public void prependClassPath(List<VirtualFile> files)
+ {
+ if (files == null)
+ throw new IllegalArgumentException("Null files");
+
+ List<VirtualFile> classPath = getMutableClassPath();
+ if (classPath == null)
+ classPath = new ArrayList<VirtualFile>();
+
+ for (int i = files.size()-1; i >= 0; --i)
+ {
+ VirtualFile file = files.get(i);
+ if (file == null)
+ throw new IllegalArgumentException("Null virtual file in " + files);
+ classPath.add(0, file);
+ }
+ setClassPath(classPath);
+ }
+
+ public void appendClassPath(VirtualFile... files)
+ {
+ if (files == null)
+ throw new IllegalArgumentException("Null files");
+
+ List<VirtualFile> classPath = getMutableClassPath();
+ if (classPath == null)
+ classPath = new ArrayList<VirtualFile>();
+
+ for (VirtualFile file : files)
+ {
+ if (file == null)
+ throw new IllegalArgumentException("Null virtual file in " + Arrays.toString(files));
+ classPath.add(file);
+ }
+ setClassPath(classPath);
+ }
+
+ public void removeClassPath(VirtualFile... files)
+ {
+ if (files == null || files.length == 0)
+ return;
+
+ for (VirtualFile file : files)
+ {
+ classPath.remove(file);
+ }
+ }
+
+ @Override
+ public VFSDeploymentContext getTopLevel()
+ {
+ return (VFSDeploymentContext) super.getTopLevel();
+ }
+
+ @Override
+ public VFSDeploymentResourceLoader getResourceLoader()
+ {
+ if (loader != null)
+ return loader;
+
+ loader = new VFSDeploymentResourceLoaderImpl(getRoot());
+ return loader;
+ }
+
+ protected DeploymentUnit createDeploymentUnit()
+ {
+ return new AbstractVFSDeploymentUnit(this);
+ }
+
+ @Override
+ public void cleanup()
+ {
+ try
+ {
+ root.cleanup();
+ }
+ finally
+ {
+ super.cleanup();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ super.readExternal(in);
+ root = (VirtualFile) in.readObject();
+ boolean isNullOrEmpty = in.readBoolean();
+ if (isNullOrEmpty == false)
+ metaDataLocations = (List<VirtualFile>) in.readObject();
+ classPath = (List) in.readObject();
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ super.writeExternal(out);
+ out.writeObject(root);
+ boolean isNullOrEmpty = metaDataLocations == null || metaDataLocations.isEmpty();
+ out.writeBoolean(isNullOrEmpty);
+ if (isNullOrEmpty == false)
+ out.writeObject(metaDataLocations);
+ out.writeObject(classPath);
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,150 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, 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.deployers.vfs.plugins.structure;
-
-import java.util.List;
-
-import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentResourceLoader;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * AbstractVFSDeploymentUnit.
- *
- * @author <a href="adrian at jboss.org">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public class AbstractVFSDeploymentUnit extends AbstractDeploymentUnit implements VFSDeploymentUnit
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = -3300229322654319315L;
-
- /**
- * For serialization
- */
- public AbstractVFSDeploymentUnit()
- {
- }
-
- /**
- * Create a new AbstractVFSDeploymentUnit.
- *
- * @param deploymentContext the deployment context
- * @throws IllegalArgumentException for a null deployment context
- */
- public AbstractVFSDeploymentUnit(VFSDeploymentContext deploymentContext)
- {
- super(deploymentContext);
- }
-
- public VirtualFile getMetaDataFile(String name)
- {
- return getDeploymentContext().getMetaDataFile(name);
- }
-
- public List<VirtualFile> getMetaDataFiles(String name, String suffix)
- {
- return getDeploymentContext().getMetaDataFiles(name, suffix);
- }
-
- @Override
- public VFSDeploymentResourceLoader getResourceLoader()
- {
- return getDeploymentContext().getResourceLoader();
- }
-
- public VirtualFile getFile(String path)
- {
- return getDeploymentContext().getFile(path);
- }
-
- public VirtualFile getRoot()
- {
- return getDeploymentContext().getRoot();
- }
-
- public List<VirtualFile> getClassPath()
- {
- return getDeploymentContext().getClassPath();
- }
-
- public void setClassPath(List<VirtualFile> classPath)
- {
- getDeploymentContext().setClassPath(classPath);
- }
-
- public void prependClassPath(List<VirtualFile> files)
- {
- getDeploymentContext().prependClassPath(files);
- }
-
- public void prependClassPath(VirtualFile... files)
- {
- getDeploymentContext().prependClassPath(files);
- }
-
- public void appendClassPath(List<VirtualFile> files)
- {
- getDeploymentContext().appendClassPath(files);
- }
-
- public void appendClassPath(VirtualFile... files)
- {
- getDeploymentContext().appendClassPath(files);
- }
-
- public void addClassPath(List<VirtualFile> files)
- {
- getDeploymentContext().appendClassPath(files);
- }
-
- public void addClassPath(VirtualFile... files)
- {
- getDeploymentContext().appendClassPath(files);
- }
-
- @Override
- public VFSDeploymentUnit getParent()
- {
- return (VFSDeploymentUnit) super.getParent();
- }
-
- @Override
- public VFSDeploymentUnit getTopLevel()
- {
- return (VFSDeploymentUnit) super.getTopLevel();
- }
-
- @SuppressWarnings("unchecked")
- public List<VFSDeploymentUnit> getVFSChildren()
- {
- return (List) super.getChildren();
- }
-
- @Override
- protected VFSDeploymentContext getDeploymentContext()
- {
- return (VFSDeploymentContext) super.getDeploymentContext();
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,171 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.deployers.vfs.plugins.structure;
+
+import java.util.List;
+
+import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentResourceLoader;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * AbstractVFSDeploymentUnit.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractVFSDeploymentUnit extends AbstractDeploymentUnit implements VFSDeploymentUnit
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -3300229322654319315L;
+
+ /**
+ * For serialization
+ */
+ public AbstractVFSDeploymentUnit()
+ {
+ }
+
+ /**
+ * Create a new AbstractVFSDeploymentUnit.
+ *
+ * @param deploymentContext the deployment context
+ * @throws IllegalArgumentException for a null deployment context
+ */
+ public AbstractVFSDeploymentUnit(VFSDeploymentContext deploymentContext)
+ {
+ super(deploymentContext);
+ }
+
+ public VirtualFile getMetaDataFile(String name)
+ {
+ return getDeploymentContext().getMetaDataFile(name);
+ }
+
+ public List<VirtualFile> getMetaDataFiles(String name, String suffix)
+ {
+ return getDeploymentContext().getMetaDataFiles(name, suffix);
+ }
+
+ public void prependMetaDataLocation(VirtualFile... locations)
+ {
+ getDeploymentContext().prependMetaDataLocation(locations);
+ }
+
+ public void appendMetaDataLocation(VirtualFile... locations)
+ {
+ getDeploymentContext().appendMetaDataLocation(locations);
+ }
+
+ public void removeMetaDataLocation(VirtualFile... locations)
+ {
+ getDeploymentContext().removeMetaDataLocation(locations);
+ }
+
+ @Override
+ public VFSDeploymentResourceLoader getResourceLoader()
+ {
+ return getDeploymentContext().getResourceLoader();
+ }
+
+ public VirtualFile getFile(String path)
+ {
+ return getDeploymentContext().getFile(path);
+ }
+
+ public VirtualFile getRoot()
+ {
+ return getDeploymentContext().getRoot();
+ }
+
+ public List<VirtualFile> getClassPath()
+ {
+ return getDeploymentContext().getClassPath();
+ }
+
+ public void setClassPath(List<VirtualFile> classPath)
+ {
+ getDeploymentContext().setClassPath(classPath);
+ }
+
+ public void prependClassPath(List<VirtualFile> files)
+ {
+ getDeploymentContext().prependClassPath(files);
+ }
+
+ public void prependClassPath(VirtualFile... files)
+ {
+ getDeploymentContext().prependClassPath(files);
+ }
+
+ public void appendClassPath(List<VirtualFile> files)
+ {
+ getDeploymentContext().appendClassPath(files);
+ }
+
+ public void appendClassPath(VirtualFile... files)
+ {
+ getDeploymentContext().appendClassPath(files);
+ }
+
+ public void addClassPath(List<VirtualFile> files)
+ {
+ getDeploymentContext().appendClassPath(files);
+ }
+
+ public void addClassPath(VirtualFile... files)
+ {
+ getDeploymentContext().appendClassPath(files);
+ }
+
+ public void removeClassPath(VirtualFile... files)
+ {
+ getDeploymentContext().removeClassPath(files);
+ }
+
+ @Override
+ public VFSDeploymentUnit getParent()
+ {
+ return (VFSDeploymentUnit) super.getParent();
+ }
+
+ @Override
+ public VFSDeploymentUnit getTopLevel()
+ {
+ return (VFSDeploymentUnit) super.getTopLevel();
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<VFSDeploymentUnit> getVFSChildren()
+ {
+ return (List) super.getChildren();
+ }
+
+ @Override
+ protected VFSDeploymentContext getDeploymentContext()
+ {
+ return (VFSDeploymentContext) super.getDeploymentContext();
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,91 +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.deployers.vfs.plugins.structure.explicit;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.vfs.plugins.structure.AbstractVFSStructureDeployer;
-import org.jboss.deployers.vfs.spi.structure.StructureContext;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-
-/**
- * A structural deployer that looks for a jboss-structure.xml descriptor as
- * the defining structure.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision: 1.1 $
- */
-public class DeclaredStructure extends AbstractVFSStructureDeployer
-{
- /**
- * Set the relative order to 0 by default.
- */
- public DeclaredStructure()
- {
- setRelativeOrder(0);
- }
-
- public boolean determineStructure(StructureContext structureContext) throws DeploymentException
- {
- VirtualFile file = structureContext.getFile();
- try
- {
- boolean trace = log.isTraceEnabled();
- if (isLeaf(file) == false)
- {
- boolean isJBossStructure = false;
- if (trace)
- log.trace(file + " is not a leaf");
- try
- {
- VirtualFile jbossStructure = file.getChild("META-INF/jboss-structure.xml");
- if (jbossStructure != null)
- {
- log.trace("... context has a META-INF/jboss-structure.xml");
- URL url = jbossStructure.toURL();
- UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
- Unmarshaller unmarshaller = factory.newUnmarshaller();
- StructureMetaDataObjectFactory ofactory = new StructureMetaDataObjectFactory();
- unmarshaller.unmarshal(url.toString(), ofactory, structureContext.getMetaData());
- isJBossStructure = true;
- }
- }
- catch (IOException e)
- {
- log.warn("Exception while looking for META-INF/jboss-structure.xml: " + e);
- }
- if (trace)
- log.trace(file + " isJBossStructure: " + isJBossStructure);
- return isJBossStructure;
- }
- }
- catch (Exception e)
- {
- throw DeploymentException.rethrowAsDeploymentException("Error determining structure: " + file.getName(), e);
- }
- return false;
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,93 @@
+/*
+* 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.deployers.vfs.plugins.structure.explicit;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.vfs.plugins.structure.AbstractVFSStructureDeployer;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+
+/**
+ * A structural deployer that looks for a jboss-structure.xml descriptor as
+ * the defining structure.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 1.1 $
+ */
+public class DeclaredStructure extends AbstractVFSStructureDeployer
+{
+ /**
+ * Set the relative order to 0 by default.
+ */
+ public DeclaredStructure()
+ {
+ setRelativeOrder(0);
+ }
+
+ public boolean determineStructure(StructureContext structureContext) throws DeploymentException
+ {
+ VirtualFile file = structureContext.getFile();
+ try
+ {
+ boolean trace = log.isTraceEnabled();
+ if (isLeaf(file) == false)
+ {
+ boolean isJBossStructure = false;
+ if (trace)
+ log.trace(file + " is not a leaf");
+ try
+ {
+ VirtualFile jbossStructure = file.getChild("META-INF/jboss-structure.xml");
+ if (jbossStructure != null)
+ {
+ if (trace)
+ log.trace("... context has a META-INF/jboss-structure.xml");
+
+ URL url = jbossStructure.toURL();
+ UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
+ Unmarshaller unmarshaller = factory.newUnmarshaller();
+ StructureMetaDataObjectFactory ofactory = new StructureMetaDataObjectFactory();
+ unmarshaller.unmarshal(url.toString(), ofactory, structureContext.getMetaData());
+ isJBossStructure = true;
+ }
+ }
+ catch (IOException e)
+ {
+ log.warn("Exception while looking for META-INF/jboss-structure.xml: " + e);
+ }
+ if (trace)
+ log.trace(file + " isJBossStructure: " + isJBossStructure);
+ return isJBossStructure;
+ }
+ }
+ catch (Exception e)
+ {
+ throw DeploymentException.rethrowAsDeploymentException("Error determining structure: " + file.getName(), e);
+ }
+ return false;
+ }
+}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/AbstractModificationTypeMatcher.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/AbstractModificationTypeMatcher.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/AbstractModificationTypeMatcher.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/AbstractModificationTypeMatcher.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,153 @@
+/*
+ * 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.deployers.vfs.plugins.structure.modify;
+
+import java.util.List;
+
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.ModificationType;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.logging.Logger;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Abstract modification type matcher.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public abstract class AbstractModificationTypeMatcher implements ModificationTypeMatcher
+{
+ protected Logger log = Logger.getLogger(getClass());
+
+ private boolean checkChildren;
+ private boolean topLevelOnly;
+ private boolean childrenOnly;
+
+ private ModificationType modificationType;
+
+ public boolean determineModification(VirtualFile root, StructureMetaData structureMetaData)
+ {
+ ContextInfo contextInfo = structureMetaData.getContext("");
+ if (childrenOnly == false)
+ {
+ boolean result = isModificationDetermined(root, contextInfo);
+ if (result)
+ {
+ contextInfo.setModificationType(modificationType);
+ return true;
+ }
+ }
+
+ if (checkChildren)
+ {
+ List<ContextInfo> contexts = structureMetaData.getContexts();
+ if (contexts != null && contexts.isEmpty() == false)
+ {
+ for (ContextInfo child : contexts)
+ {
+ String path = child.getPath();
+ // Only process the child contexts
+ if ("".equals(path) == false)
+ {
+ try
+ {
+ VirtualFile file = root.getChild(path);
+ if (file != null && isModificationDetermined(file, child))
+ {
+ contextInfo.setModificationType(modificationType);
+ return true;
+ }
+ }
+ catch (Exception e)
+ {
+ log.debug("Exception checking child context (" + child + ") for modification, cause: " + e);
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean determineModification(VirtualFile root, ContextInfo contextInfo)
+ {
+ boolean result = false;
+ if (topLevelOnly == false)
+ {
+ result = isModificationDetermined(root, contextInfo);
+ if (result)
+ {
+ contextInfo.setModificationType(modificationType);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Is modification determined.
+ *
+ * @param file the file
+ * @param contextInfo the context info
+ * @return true if we should apply modification type, false otherwise
+ */
+ protected abstract boolean isModificationDetermined(VirtualFile file, ContextInfo contextInfo);
+
+ /**
+ * Do we apply modification to the top structure context.
+ *
+ * @param checkChildren the apply to top flag
+ */
+ public void setCheckChildren(boolean checkChildren)
+ {
+ this.checkChildren = checkChildren;
+ }
+
+ /**
+ * Is this matcher top level only.
+ *
+ * @param topLevelOnly the top level only flag
+ */
+ public void setTopLevelOnly(boolean topLevelOnly)
+ {
+ this.topLevelOnly = topLevelOnly;
+ }
+
+ /**
+ * Is this matcher children only.
+ *
+ * @param childrenOnly the children only flag
+ */
+ public void setChildrenOnly(boolean childrenOnly)
+ {
+ this.childrenOnly = childrenOnly;
+ }
+
+ /**
+ * Set the modification type.
+ *
+ * @param modificationType the modification type
+ */
+ public void setModificationType(ModificationType modificationType)
+ {
+ this.modificationType = modificationType;
+ }
+}
\ No newline at end of file
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/FileModificationTypeMatcher.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/FileModificationTypeMatcher.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/FileModificationTypeMatcher.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/FileModificationTypeMatcher.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,118 @@
+/*
+ * 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.deployers.vfs.plugins.structure.modify;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.ArrayList;
+
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * File modification type matcher.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class FileModificationTypeMatcher extends AbstractModificationTypeMatcher
+{
+ private String[] paths;
+ private boolean metadataOnly;
+
+ public FileModificationTypeMatcher(String... paths)
+ {
+ if (paths == null || paths.length == 0)
+ throw new IllegalArgumentException("Null or empty paths");
+
+ this.paths = paths;
+ }
+
+ protected boolean isModificationDetermined(VirtualFile root, ContextInfo contextInfo)
+ {
+ for (String path : paths)
+ {
+ for (VirtualFile file : getStartingFiles(root, contextInfo))
+ {
+ try
+ {
+ if (file.getChild(path) != null)
+ return true;
+ }
+ catch (Exception e)
+ {
+ log.debug("Cannot determine modification type, cause: " + e);
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Get starting files for path check.
+ *
+ * @param file the current file
+ * @param contextInfo the context info
+ * @return list of starting files
+ */
+ protected List<VirtualFile> getStartingFiles(VirtualFile file, ContextInfo contextInfo)
+ {
+ if (metadataOnly)
+ {
+ List<String> metadataPaths = contextInfo.getMetaDataPath();
+ if (metadataPaths == null || metadataPaths.isEmpty())
+ {
+ return Collections.emptyList();
+ }
+ else
+ {
+ List<VirtualFile> result = new ArrayList<VirtualFile>(metadataPaths.size());
+ for (String metadataPath : metadataPaths)
+ {
+ try
+ {
+ VirtualFile child = file.getChild(metadataPath);
+ if (child != null)
+ result.add(child);
+ }
+ catch (Exception ignored)
+ {
+ }
+ }
+ return result;
+ }
+ }
+ else
+ {
+ return Collections.singletonList(file);
+ }
+ }
+
+ /**
+ * Should we check metadata only.
+ *
+ * @param metadataOnly the metadata only flag
+ */
+ public void setMetadataOnly(boolean metadataOnly)
+ {
+ this.metadataOnly = metadataOnly;
+ }
+}
\ No newline at end of file
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeMatcher.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeMatcher.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeMatcher.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeMatcher.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,52 @@
+/*
+ * 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.deployers.vfs.plugins.structure.modify;
+
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Determine if we need some modification.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface ModificationTypeMatcher
+{
+ /**
+ * Should we modify the file.
+ *
+ * @param root the deployment root
+ * @param structureMetaData the current structure metadata
+ * @return true if we determined modification
+ */
+ boolean determineModification(VirtualFile root, StructureMetaData structureMetaData);
+
+ /**
+ * Should we modify the file.
+ *
+ * @param root the deployment root
+ * @param contextInfo the current context info
+ * @return true if we determined modification
+ */
+ boolean determineModification(VirtualFile root, ContextInfo contextInfo);
+}
\ No newline at end of file
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeStructureProcessor.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeStructureProcessor.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeStructureProcessor.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeStructureProcessor.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,155 @@
+/*
+ * 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.deployers.vfs.plugins.structure.modify;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.structure.spi.StructureProcessor;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Determine if we need some modification.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class ModificationTypeStructureProcessor implements StructureProcessor
+{
+ private List<ModificationTypeMatcher> matchers;
+
+ public void prepareStructureMetaData(Deployment deployment, StructureMetaData structureMetaData)
+ {
+ if (deployment instanceof VFSDeployment == false)
+ return;
+
+ VFSDeployment vfsDeployment = VFSDeployment.class.cast(deployment);
+ VirtualFile root = vfsDeployment.getRoot();
+ checkForModification(root, structureMetaData);
+ }
+
+ public void prepareContextInfo(DeploymentContext parentDeploymentContext, ContextInfo contextInfo)
+ {
+ if (parentDeploymentContext instanceof VFSDeploymentContext == false || contextInfo == null)
+ return;
+
+ VFSDeploymentContext vfsParentDeploymentContext = VFSDeploymentContext.class.cast(parentDeploymentContext);
+ VirtualFile root = vfsParentDeploymentContext.getFile(contextInfo.getPath());
+ checkForModification(root, contextInfo);
+ }
+
+ public void applyStructureMetaData(DeploymentContext deploymentContext, StructureMetaData structureMetaData)
+ {
+ }
+
+ public void applyContextInfo(DeploymentContext deploymentContext, ContextInfo contextInfo)
+ {
+ }
+
+ /**
+ * Check for modification.
+ *
+ * @param root the deployment root
+ * @param structureMetaData the structure metadata
+ */
+ protected void checkForModification(VirtualFile root, StructureMetaData structureMetaData)
+ {
+ ContextInfo contex = structureMetaData.getContext("");
+ if (contex == null || contex.getModificationType() != null)
+ return;
+
+ if (matchers != null && matchers.isEmpty() == false)
+ {
+ for (ModificationTypeMatcher matcher : matchers)
+ {
+ if (matcher.determineModification(root, structureMetaData))
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Check for modification.
+ *
+ * @param root the deployment root
+ * @param contextInfo the context info
+ */
+ protected void checkForModification(VirtualFile root, ContextInfo contextInfo)
+ {
+ if (root == null || contextInfo == null || contextInfo.getModificationType() != null)
+ return;
+
+ if (matchers != null && matchers.isEmpty() == false)
+ {
+ for (ModificationTypeMatcher matcher : matchers)
+ {
+ if (matcher.determineModification(root, contextInfo))
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Set modification type matchers.
+ *
+ * @param matchers the modification type matchers.
+ */
+ public void setMatchers(List<ModificationTypeMatcher> matchers)
+ {
+ this.matchers = matchers;
+ }
+
+ /**
+ * Add modification type matcher.
+ *
+ * @param matcher the modification type matcher
+ */
+ public void addMatcher(ModificationTypeMatcher matcher)
+ {
+ if (matchers == null)
+ matchers = new ArrayList<ModificationTypeMatcher>();
+
+ matchers.add(matcher);
+ }
+
+ /**
+ * Remove modification type matcher.
+ *
+ * @param matcher the modification type matcher
+ */
+ public void removeMatcher(ModificationTypeMatcher matcher)
+ {
+ if (matchers != null)
+ {
+ matchers.remove(matcher);
+ }
+ }
+}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/TempTopModificationTypeMatcher.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/TempTopModificationTypeMatcher.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/TempTopModificationTypeMatcher.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/TempTopModificationTypeMatcher.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,40 @@
+/*
+ * 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.deployers.vfs.plugins.structure.modify;
+
+import org.jboss.deployers.spi.structure.ModificationType;
+
+/**
+ * Temp top modification type matcher.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class TempTopModificationTypeMatcher extends FileModificationTypeMatcher
+{
+ public TempTopModificationTypeMatcher(String... paths)
+ {
+ super(paths);
+ setCheckChildren(true);
+ setModificationType(ModificationType.TEMP);
+ setTopLevelOnly(true);
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="urn:jboss:deployers:2.0"
- xmlns="urn:jboss:deployers:2.0"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.0">
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- An xml schema for the deployers xml that can be used in a -beans.xml
- to create a schema resolver deployer.
-
- Typical usage:
- <jbossxb-parser xmlns="urn:jboss:deployers:2.0"
- name="FooParser"
- class="com.foo.MetaData"
- suffix="-foo.xml"/> ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:element name="jbossxb-parser" type="parserType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- The root classloader element
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:complexType name="parserType">
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- This parser element/type has a bunch of attributes.
- To see which they are, check the SchemaResolverDeployer class.
- ]]>
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- <xsd:attribute name="metadata" type="xsd:string" use="required" />
- <xsd:attribute name="suffix" type="xsd:string" use="optional" />
- <xsd:attribute name="file-name" type="xsd:string" use="optional" />
- <xsd:attribute name="use-schema-validation" type="xsd:boolean" use="optional" />
- <xsd:attribute name="use-validation" type="xsd:boolean" use="optional" />
- <xsd:attribute name="register-with-jbossxb" type="xsd:boolean" use="optional" />
- <xsd:attribute name="jar-extension" type="xsd:string" use="optional" />
- <xsd:attribute name="include-deployment-file" type="xsd:boolean" use="optional" />
- <xsd:attribute name="build-managed-object" type="xsd:boolean" use="optional" />
- </xsd:complexType>
-</xsd:schema>
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:deployers:2.0"
+ xmlns="urn:jboss:deployers:2.0"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="1.0">
+
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ An xml schema for the deployers xml that can be used in a -beans.xml
+ to create a schema resolver deployer.
+
+ Typical usage:
+ <jbossxb-parser xmlns="urn:jboss:deployers:2.0"
+ name="FooParser"
+ class="com.foo.MetaData"
+ suffix="-foo.xml"/> ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:element name="jbossxb-parser" type="parserType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ The root parser type element
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+
+ <xsd:complexType name="parserType">
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ This parser element/type has a bunch of attributes.
+ To see which they are, check the SchemaResolverDeployer class.
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="metadata" type="xsd:string" use="required" />
+ <xsd:attribute name="suffix" type="xsd:string" use="optional" />
+ <xsd:attribute name="file-name" type="xsd:string" use="optional" />
+ <xsd:attribute name="use-schema-validation" type="xsd:boolean" use="optional" />
+ <xsd:attribute name="use-validation" type="xsd:boolean" use="optional" />
+ <xsd:attribute name="register-with-jbossxb" type="xsd:boolean" use="optional" />
+ <xsd:attribute name="jar-extension" type="xsd:string" use="optional" />
+ <xsd:attribute name="include-deployment-file" type="xsd:boolean" use="optional" />
+ <xsd:attribute name="build-managed-object" type="xsd:boolean" use="optional" />
+ </xsd:complexType>
+</xsd:schema>
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,83 +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.deployers;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-import org.jboss.test.deployers.vfs.annotations.AnnotationScanningTestSuite;
-import org.jboss.test.deployers.vfs.classloader.ClassLoaderTestSuite;
-import org.jboss.test.deployers.vfs.dependency.DependencyTestSuite;
-import org.jboss.test.deployers.vfs.deployer.bean.BeanDeployerTestSuite;
-import org.jboss.test.deployers.vfs.deployer.facelets.FaceletsTestSuite;
-import org.jboss.test.deployers.vfs.deployer.jaxp.JAXPDeployerTestSuite;
-import org.jboss.test.deployers.vfs.deployer.merge.MergeDeployerTestSuite;
-import org.jboss.test.deployers.vfs.deployer.nonmetadata.NonMetadataDeployersTestSuite;
-import org.jboss.test.deployers.vfs.deployer.validate.ValidateDeployerTestSuite;
-import org.jboss.test.deployers.vfs.deploymentfactory.VFSDeploymentFactoryTestSuite;
-import org.jboss.test.deployers.vfs.managed.VFSManagedTestSuite;
-import org.jboss.test.deployers.vfs.matchers.VFSMatchersTestSuite;
-import org.jboss.test.deployers.vfs.metadata.VFSMetaDataTestSuite;
-import org.jboss.test.deployers.vfs.parsing.test.ParsingTestSuite;
-import org.jboss.test.deployers.vfs.structure.VFSStructureTestSuite;
-import org.jboss.test.deployers.vfs.structurebuilder.VFSStructureBuilderTestSuite;
-import org.jboss.test.deployers.vfs.xb.JBossXBDeployersTestSuite;
-
-/**
- * Deployers VFS Test Suite.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- * @version $Revision: 37459 $
- */
-public class DeployersVFSTestSuite extends TestSuite
-{
- public static void main(String[] args)
- {
- TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("Deployers VFS Tests");
-
- suite.addTest(VFSDeploymentFactoryTestSuite.suite());
- suite.addTest(VFSStructureBuilderTestSuite.suite());
- suite.addTest(VFSStructureTestSuite.suite());
- suite.addTest(VFSMetaDataTestSuite.suite());
- suite.addTest(ParsingTestSuite.suite());
- suite.addTest(JAXPDeployerTestSuite.suite());
- suite.addTest(BeanDeployerTestSuite.suite());
- suite.addTest(VFSManagedTestSuite.suite());
- suite.addTest(NonMetadataDeployersTestSuite.suite());
- suite.addTest(ClassLoaderTestSuite.suite());
- suite.addTest(VFSMatchersTestSuite.suite());
- suite.addTest(JBossXBDeployersTestSuite.suite());
- suite.addTest(MergeDeployerTestSuite.suite());
- suite.addTest(FaceletsTestSuite.suite());
- suite.addTest(ValidateDeployerTestSuite.suite());
- suite.addTest(AnnotationScanningTestSuite.suite());
- suite.addTest(DependencyTestSuite.suite());
-
- return suite;
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,85 @@
+/*
+* 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.deployers;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+import org.jboss.test.deployers.vfs.annotations.AnnotationScanningTestSuite;
+import org.jboss.test.deployers.vfs.classloader.ClassLoaderTestSuite;
+import org.jboss.test.deployers.vfs.dependency.DependencyTestSuite;
+import org.jboss.test.deployers.vfs.deployer.bean.BeanDeployerTestSuite;
+import org.jboss.test.deployers.vfs.deployer.facelets.FaceletsTestSuite;
+import org.jboss.test.deployers.vfs.deployer.jaxp.JAXPDeployerTestSuite;
+import org.jboss.test.deployers.vfs.deployer.merge.MergeDeployerTestSuite;
+import org.jboss.test.deployers.vfs.deployer.nonmetadata.NonMetadataDeployersTestSuite;
+import org.jboss.test.deployers.vfs.deployer.validate.ValidateDeployerTestSuite;
+import org.jboss.test.deployers.vfs.deploymentfactory.VFSDeploymentFactoryTestSuite;
+import org.jboss.test.deployers.vfs.managed.VFSManagedTestSuite;
+import org.jboss.test.deployers.vfs.matchers.VFSMatchersTestSuite;
+import org.jboss.test.deployers.vfs.metadata.VFSMetaDataTestSuite;
+import org.jboss.test.deployers.vfs.parsing.test.ParsingTestSuite;
+import org.jboss.test.deployers.vfs.structure.VFSStructureTestSuite;
+import org.jboss.test.deployers.vfs.structurebuilder.VFSStructureBuilderTestSuite;
+import org.jboss.test.deployers.vfs.structureprocessor.VFSStructureProcessorTestSuite;
+import org.jboss.test.deployers.vfs.xb.JBossXBDeployersTestSuite;
+
+/**
+ * Deployers VFS Test Suite.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ * @version $Revision: 37459 $
+ */
+public class DeployersVFSTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("Deployers VFS Tests");
+
+ suite.addTest(VFSDeploymentFactoryTestSuite.suite());
+ suite.addTest(VFSStructureBuilderTestSuite.suite());
+ suite.addTest(VFSStructureProcessorTestSuite.suite());
+ suite.addTest(VFSStructureTestSuite.suite());
+ suite.addTest(VFSMetaDataTestSuite.suite());
+ suite.addTest(ParsingTestSuite.suite());
+ suite.addTest(JAXPDeployerTestSuite.suite());
+ suite.addTest(BeanDeployerTestSuite.suite());
+ suite.addTest(VFSManagedTestSuite.suite());
+ suite.addTest(NonMetadataDeployersTestSuite.suite());
+ suite.addTest(ClassLoaderTestSuite.suite());
+ suite.addTest(VFSMatchersTestSuite.suite());
+ suite.addTest(JBossXBDeployersTestSuite.suite());
+ suite.addTest(MergeDeployerTestSuite.suite());
+ suite.addTest(FaceletsTestSuite.suite());
+ suite.addTest(ValidateDeployerTestSuite.suite());
+ suite.addTest(AnnotationScanningTestSuite.suite());
+ suite.addTest(DependencyTestSuite.suite());
+
+ return suite;
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,120 +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.deployers.vfs.dependency.test;
-
-import junit.framework.Test;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.test.deployers.BootstrapDeployersTest;
-
-/**
- * DependenciesTestCase.
- *
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class DependenciesTestCase extends BootstrapDeployersTest
-{
- public DependenciesTestCase(String name)
- {
- super(name);
- }
-
- public static Test suite()
- {
- return suite(DependenciesTestCase.class);
- }
-
- protected void assertDeployment(DeploymentUnit unit, ControllerState state)
- {
- ControllerContext context = unit.getAttachment(ControllerContext.class);
- assertNotNull(context);
- assertEquals(state, context.getState());
- }
-
- public void testBeanDependency() throws Throwable
- {
- DeploymentUnit du = addDeployment("/dependency", "bean");
- try
- {
- assertDeployment(du, new ControllerState("PreReal"));
- DeploymentUnit tmDU = assertDeploy("/dependency", "support");
- try
- {
- assertDeployment(du, ControllerState.INSTALLED);
- }
- finally
- {
- undeploy(tmDU);
- }
- }
- finally
- {
- undeploy(du);
- }
- }
-
- public void testModuleAndAliasDependency() throws Throwable
- {
- DeploymentUnit du = addDeployment("/dependency", "module");
- try
- {
- assertDeployment(du, ControllerState.PRE_INSTALL);
- DeploymentUnit aliasDU = assertDeploy("/dependency", "alias");
- try
- {
- assertDeployment(aliasDU, ControllerState.INSTALLED);
- assertDeployment(du, ControllerState.INSTALLED);
- }
- finally
- {
- undeploy(aliasDU);
- }
- }
- finally
- {
- undeploy(du);
- }
- }
-
- public void testNestedDependency() throws Throwable
- {
- DeploymentUnit du = addDeployment("/dependency", "nested");
- try
- {
- assertDeployment(du, new ControllerState("PreReal"));
- DeploymentUnit tmDU = assertDeploy("/dependency", "support");
- try
- {
- assertDeployment(du, ControllerState.INSTALLED);
- }
- finally
- {
- undeploy(tmDU);
- }
- }
- finally
- {
- undeploy(du);
- }
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,179 @@
+/*
+ * 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.deployers.vfs.dependency.test;
+
+import junit.framework.Test;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.test.deployers.BootstrapDeployersTest;
+
+/**
+ * DependenciesTestCase.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class DependenciesTestCase extends BootstrapDeployersTest
+{
+ public DependenciesTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(DependenciesTestCase.class);
+ }
+
+ protected void assertDeployment(DeploymentUnit unit, ControllerState state)
+ {
+ ControllerContext context = unit.getAttachment(ControllerContext.class);
+ assertNotNull(context);
+ assertEquals(state, context.getState());
+ }
+
+ public void testBeanDependency() throws Throwable
+ {
+ DeploymentUnit du = addDeployment("/dependency", "bean");
+ try
+ {
+ assertDeployment(du, new ControllerState("PreReal"));
+ DeploymentUnit tmDU = assertDeploy("/dependency", "support");
+ try
+ {
+ assertDeployment(du, ControllerState.INSTALLED);
+ }
+ finally
+ {
+ undeploy(tmDU);
+ }
+ }
+ finally
+ {
+ undeploy(du);
+ }
+ }
+
+ public void testModuleAndAliasDependency() throws Throwable
+ {
+ DeploymentUnit du = addDeployment("/dependency", "module");
+ try
+ {
+ assertDeployment(du, ControllerState.PRE_INSTALL);
+ DeploymentUnit aliasDU = assertDeploy("/dependency", "alias");
+ try
+ {
+ assertDeployment(aliasDU, ControllerState.INSTALLED);
+ assertDeployment(du, ControllerState.INSTALLED);
+ }
+ finally
+ {
+ undeploy(aliasDU);
+ }
+ }
+ finally
+ {
+ undeploy(du);
+ }
+ }
+
+ public void testNestedDependency() throws Throwable
+ {
+ DeploymentUnit du = addDeployment("/dependency", "nested");
+ try
+ {
+ assertDeployment(du, new ControllerState("PreReal"));
+ DeploymentUnit tmDU = assertDeploy("/dependency", "support");
+ try
+ {
+ assertDeployment(du, ControllerState.INSTALLED);
+ }
+ finally
+ {
+ undeploy(tmDU);
+ }
+ }
+ finally
+ {
+ undeploy(du);
+ }
+ }
+
+ public void testBeanRedeploy() throws Throwable
+ {
+ DeploymentUnit du = addDeployment("/dependency", "bean");
+ try
+ {
+ assertDeployment(du, new ControllerState("PreReal"));
+ DeploymentUnit tmDU = assertDeploy("/dependency", "support");
+ try
+ {
+ assertDeployment(du, ControllerState.INSTALLED);
+
+ undeploy(tmDU);
+
+ assertDeployment(du, new ControllerState("PreReal"));
+
+ tmDU = assertDeploy("/dependency", "support");
+
+ assertDeployment(du, ControllerState.INSTALLED);
+ }
+ finally
+ {
+ undeploy(tmDU);
+ }
+ }
+ finally
+ {
+ undeploy(du);
+ }
+ }
+
+ public void testModuleAndAliasRedeploy() throws Throwable
+ {
+ DeploymentUnit du = addDeployment("/dependency", "module");
+ try
+ {
+ assertDeployment(du, ControllerState.PRE_INSTALL);
+ DeploymentUnit aliasDU = assertDeploy("/dependency", "alias");
+ try
+ {
+ assertDeployment(aliasDU, ControllerState.INSTALLED);
+ assertDeployment(du, ControllerState.INSTALLED);
+
+ undeploy(aliasDU);
+ assertDeployment(du, ControllerState.PRE_INSTALL);
+
+ aliasDU = assertDeploy("/dependency", "alias");
+ assertDeployment(du, ControllerState.INSTALLED);
+ }
+ finally
+ {
+ undeploy(aliasDU);
+ }
+ }
+ finally
+ {
+ undeploy(du);
+ }
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,191 +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.deployers.vfs.deployer.validate.support;
-
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URI;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.spi.VirtualFileHandler;
-import org.jboss.virtual.spi.VFSContext;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class MyVirtualFile extends VirtualFile
-{
- /**
- * The serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public MyVirtualFile()
- {
- super(getVirtualFileHandler());
- }
-
- public String getName()
- {
- return "";
- }
-
- public InputStream openStream() throws IOException
- {
- return null;
- }
-
- private static VirtualFileHandler getVirtualFileHandler()
- {
- return new VirtualFileHandler()
- {
- /**
- * The serialVersionUID
- */
- private static final long serialVersionUID = 1L;
-
- public String getName()
- {
- return null;
- }
-
- public String getPathName()
- {
- return null;
- }
-
- public URL toVfsUrl() throws MalformedURLException, URISyntaxException
- {
- return null;
- }
-
- public URI toURI() throws URISyntaxException
- {
- return null;
- }
-
- public URL toURL() throws MalformedURLException, URISyntaxException
- {
- return null;
- }
-
- public long getLastModified() throws IOException
- {
- return 0;
- }
-
- public boolean hasBeenModified() throws IOException
- {
- return false;
- }
-
- public long getSize() throws IOException
- {
- return 0;
- }
-
- public boolean exists() throws IOException
- {
- return false;
- }
-
- public boolean isLeaf() throws IOException
- {
- return true;
- }
-
- public boolean isHidden() throws IOException
- {
- return false;
- }
-
- public String getLocalPathName()
- {
- return null;
- }
-
- public boolean isNested() throws IOException
- {
- return false;
- }
-
- public InputStream openStream() throws IOException
- {
- return null;
- }
-
- public VirtualFileHandler getParent() throws IOException
- {
- return null;
- }
-
- public List<VirtualFileHandler> getChildren(boolean ignoreErrors) throws IOException
- {
- return null;
- }
-
- public VirtualFileHandler getChild(String path) throws IOException
- {
- return null;
- }
-
- public VFSContext getVFSContext()
- {
- return null;
- }
-
- public VirtualFile getVirtualFile()
- {
- return null;
- }
-
- public void close()
- {
-
- }
-
- public void replaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
- {
-
- }
-
- public boolean removeChild(String name) throws IOException
- {
- return false;
- }
-
- public boolean delete(int gracePeriod) throws IOException
- {
- return false;
- }
-
- public URL getRealURL() throws IOException, URISyntaxException
- {
- return null;
- }
- };
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,195 @@
+/*
+* 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.deployers.vfs.deployer.validate.support;
+
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URI;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.spi.VirtualFileHandler;
+import org.jboss.virtual.spi.VFSContext;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class MyVirtualFile extends VirtualFile
+{
+ /**
+ * The serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public MyVirtualFile()
+ {
+ super(getVirtualFileHandler());
+ }
+
+ public String getName()
+ {
+ return "";
+ }
+
+ public InputStream openStream() throws IOException
+ {
+ return null;
+ }
+
+ private static VirtualFileHandler getVirtualFileHandler()
+ {
+ return new VirtualFileHandler()
+ {
+ /**
+ * The serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public String getPathName()
+ {
+ return null;
+ }
+
+ public URL toVfsUrl() throws MalformedURLException, URISyntaxException
+ {
+ return null;
+ }
+
+ public URI toURI() throws URISyntaxException
+ {
+ return null;
+ }
+
+ public URL toURL() throws MalformedURLException, URISyntaxException
+ {
+ return null;
+ }
+
+ public long getLastModified() throws IOException
+ {
+ return 0;
+ }
+
+ public boolean hasBeenModified() throws IOException
+ {
+ return false;
+ }
+
+ public long getSize() throws IOException
+ {
+ return 0;
+ }
+
+ public boolean exists() throws IOException
+ {
+ return false;
+ }
+
+ public boolean isLeaf() throws IOException
+ {
+ return true;
+ }
+
+ public boolean isHidden() throws IOException
+ {
+ return false;
+ }
+
+ public String getLocalPathName()
+ {
+ return null;
+ }
+
+ public boolean isNested() throws IOException
+ {
+ return false;
+ }
+
+ public InputStream openStream() throws IOException
+ {
+ return null;
+ }
+
+ public VirtualFileHandler getParent() throws IOException
+ {
+ return null;
+ }
+
+ public List<VirtualFileHandler> getChildren(boolean ignoreErrors) throws IOException
+ {
+ return null;
+ }
+
+ public VirtualFileHandler getChild(String path) throws IOException
+ {
+ return null;
+ }
+
+ public VFSContext getVFSContext()
+ {
+ return null;
+ }
+
+ public VirtualFile getVirtualFile()
+ {
+ return null;
+ }
+
+ public void close()
+ {
+
+ }
+
+ public void replaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
+ {
+
+ }
+
+ public boolean removeChild(String name) throws IOException
+ {
+ return false;
+ }
+
+ public boolean delete(int gracePeriod) throws IOException
+ {
+ return false;
+ }
+
+ public URL getRealURL() throws IOException, URISyntaxException
+ {
+ return null;
+ }
+
+ public void cleanup()
+ {
+ }
+ };
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,211 +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.deployers.vfs.parsing.test;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.List;
-
-import junit.framework.Test;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentContext;
-import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.test.BaseTestCase;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
-
-/**
- * alt-dd tests.
- *
- * @author <a href="mailto:alex at jboss.com">Alexey Loubyansky</a>
- */
-public class DeployersAltDDTestCase extends BaseTestCase
-{
- public static Test suite()
- {
- return suite(DeployersAltDDTestCase.class);
- }
-
- public DeployersAltDDTestCase(String test)
- {
- super(test);
- }
-
- public void testAltDD() throws Exception
- {
- final VirtualFile altDD = getMockVF();
- AbstractVFSDeploymentContext context = new AbstractVFSDeploymentContext();
- DeploymentUnit unit = context.getDeploymentUnit();
- unit.addAttachment(Object.class.getName() + ".altDD", altDD);
-
- final boolean pickedUpAltDD[] = new boolean[1];
- AbstractVFSParsingDeployer<Object> deployer = new AbstractVFSParsingDeployer<Object>(Object.class)
- {
- @Override
- protected Object parse(VFSDeploymentUnit unit, VirtualFile file, Object root) throws Exception
- {
- if(file == altDD)
- pickedUpAltDD[0] = true;
- return null;
- }
- };
-
- deployer.setName("dd");
- deployer.deploy(unit);
-
- assertTrue("Picked up alt-dd", pickedUpAltDD[0]);
- }
-
- private static VirtualFile getMockVF()
- {
- VirtualFile altDD = new VirtualFile(new VirtualFileHandler()
- {
- private static final long serialVersionUID = 1L;
-
- public void close()
- {
- }
-
- public boolean exists() throws IOException
- {
- return false;
- }
-
- public VirtualFileHandler getChild(String arg0) throws IOException
- {
- return null;
- }
-
- public List<VirtualFileHandler> getChildren(boolean arg0) throws IOException
- {
- return null;
- }
-
- public long getLastModified() throws IOException
- {
- return 0;
- }
-
- public String getName()
- {
- return null;
- }
-
- public VirtualFileHandler getParent() throws IOException
- {
- return null;
- }
-
- public String getPathName()
- {
- return null;
- }
-
- public long getSize() throws IOException
- {
- return 0;
- }
-
- public VFSContext getVFSContext()
- {
- return null;
- }
-
- public VirtualFile getVirtualFile()
- {
- return null;
- }
-
- public boolean hasBeenModified() throws IOException
- {
- return false;
- }
-
- public boolean isHidden() throws IOException
- {
- return false;
- }
-
- public boolean isLeaf() throws IOException
- {
- return false;
- }
-
- public String getLocalPathName()
- {
- return null;
- }
-
- public boolean isNested() throws IOException
- {
- return false;
- }
-
- public InputStream openStream() throws IOException
- {
- return null;
- }
-
- public URI toURI() throws URISyntaxException
- {
- return null;
- }
-
- public URL toURL() throws MalformedURLException, URISyntaxException
- {
- return null;
- }
-
- public URL toVfsUrl() throws MalformedURLException, URISyntaxException
- {
- return null;
- }
-
- public void replaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
- {
-
- }
-
- public boolean removeChild(String name) throws IOException
- {
- return false;
- }
-
- public boolean delete(int gracePeriod) throws IOException
- {
- return false;
- }
-
- public URL getRealURL() throws IOException, URISyntaxException
- {
- return null;
- }
- });
- return altDD;
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,215 @@
+/*
+* 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.deployers.vfs.parsing.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.List;
+
+import junit.framework.Test;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentContext;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.test.BaseTestCase;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.spi.VFSContext;
+import org.jboss.virtual.spi.VirtualFileHandler;
+
+/**
+ * alt-dd tests.
+ *
+ * @author <a href="mailto:alex at jboss.com">Alexey Loubyansky</a>
+ */
+public class DeployersAltDDTestCase extends BaseTestCase
+{
+ public static Test suite()
+ {
+ return suite(DeployersAltDDTestCase.class);
+ }
+
+ public DeployersAltDDTestCase(String test)
+ {
+ super(test);
+ }
+
+ public void testAltDD() throws Exception
+ {
+ final VirtualFile altDD = getMockVF();
+ AbstractVFSDeploymentContext context = new AbstractVFSDeploymentContext();
+ DeploymentUnit unit = context.getDeploymentUnit();
+ unit.addAttachment(Object.class.getName() + ".altDD", altDD);
+
+ final boolean pickedUpAltDD[] = new boolean[1];
+ AbstractVFSParsingDeployer<Object> deployer = new AbstractVFSParsingDeployer<Object>(Object.class)
+ {
+ @Override
+ protected Object parse(VFSDeploymentUnit unit, VirtualFile file, Object root) throws Exception
+ {
+ if(file == altDD)
+ pickedUpAltDD[0] = true;
+ return null;
+ }
+ };
+
+ deployer.setName("dd");
+ deployer.deploy(unit);
+
+ assertTrue("Picked up alt-dd", pickedUpAltDD[0]);
+ }
+
+ private static VirtualFile getMockVF()
+ {
+ VirtualFile altDD = new VirtualFile(new VirtualFileHandler()
+ {
+ private static final long serialVersionUID = 1L;
+
+ public void close()
+ {
+ }
+
+ public boolean exists() throws IOException
+ {
+ return false;
+ }
+
+ public VirtualFileHandler getChild(String arg0) throws IOException
+ {
+ return null;
+ }
+
+ public List<VirtualFileHandler> getChildren(boolean arg0) throws IOException
+ {
+ return null;
+ }
+
+ public long getLastModified() throws IOException
+ {
+ return 0;
+ }
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public VirtualFileHandler getParent() throws IOException
+ {
+ return null;
+ }
+
+ public String getPathName()
+ {
+ return null;
+ }
+
+ public long getSize() throws IOException
+ {
+ return 0;
+ }
+
+ public VFSContext getVFSContext()
+ {
+ return null;
+ }
+
+ public VirtualFile getVirtualFile()
+ {
+ return null;
+ }
+
+ public boolean hasBeenModified() throws IOException
+ {
+ return false;
+ }
+
+ public boolean isHidden() throws IOException
+ {
+ return false;
+ }
+
+ public boolean isLeaf() throws IOException
+ {
+ return false;
+ }
+
+ public String getLocalPathName()
+ {
+ return null;
+ }
+
+ public boolean isNested() throws IOException
+ {
+ return false;
+ }
+
+ public InputStream openStream() throws IOException
+ {
+ return null;
+ }
+
+ public URI toURI() throws URISyntaxException
+ {
+ return null;
+ }
+
+ public URL toURL() throws MalformedURLException, URISyntaxException
+ {
+ return null;
+ }
+
+ public URL toVfsUrl() throws MalformedURLException, URISyntaxException
+ {
+ return null;
+ }
+
+ public void replaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
+ {
+
+ }
+
+ public boolean removeChild(String name) throws IOException
+ {
+ return false;
+ }
+
+ public boolean delete(int gracePeriod) throws IOException
+ {
+ return false;
+ }
+
+ public URL getRealURL() throws IOException, URISyntaxException
+ {
+ return null;
+ }
+
+ public void cleanup()
+ {
+ }
+ });
+ return altDD;
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,246 +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.deployers.vfs.structure.file.test;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.List;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
-import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.test.BaseTestCase;
-import org.jboss.test.deployers.vfs.structure.file.support.BshFileMatcher;
-import org.jboss.test.deployers.vfs.structure.file.support.TmpFileStructure;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.spi.VFSContext;
-import org.jboss.virtual.spi.VirtualFileHandler;
-
-/**
- * FileMatcherTestCase.
- *
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- */
-public class FileMatcherTestCase extends BaseTestCase
-{
- public static Test suite()
- {
- return new TestSuite(FileMatcherTestCase.class);
- }
-
- public FileMatcherTestCase(String name)
- {
- super(name);
- }
-
- protected VirtualFile getVirtualFile() throws Throwable
- {
- return new MyVirtualFile();
- }
-
- public void testMatcher() throws Throwable
- {
- BasicBootstrap bootstrap = new BasicBootstrap();
- bootstrap.run();
- Kernel kernel = bootstrap.getKernel();
- KernelController controller = kernel.getController();
- try
- {
- BeanMetaData fsMD = new AbstractBeanMetaData("fileStructure", TmpFileStructure.class.getName());
- KernelControllerContext fsCC = controller.install(fsMD);
- assertEquals(fsCC.getState(), ControllerState.INSTALLED);
- TmpFileStructure fs = (TmpFileStructure)fsCC.getTarget();
- assertNotNull(fs);
-
- VirtualFile file = getVirtualFile();
- assertFalse(fs.checkFileMatchers(file));
-
- BeanMetaData fmMD = new AbstractBeanMetaData("bshFileMatcher", BshFileMatcher.class.getName());
- controller.install(fmMD);
-
- assertTrue(fs.checkFileMatchers(file));
-
- controller.uninstall(fmMD.getName());
-
- assertFalse(fs.checkFileMatchers(file));
- }
- finally
- {
- controller.shutdown();
- }
- }
-
- private static class MyVirtualFile extends VirtualFile
- {
- /** The serialVersionUID */
- private static final long serialVersionUID = 1L;
-
- public MyVirtualFile()
- {
- super(getVirtualFileHandler());
- }
-
- private static VirtualFileHandler getVirtualFileHandler()
- {
- return new VirtualFileHandler()
- {
- /** The serialVersionUID */
- private static final long serialVersionUID = 1L;
-
- public String getName()
- {
- return null;
- }
-
- public String getPathName()
- {
- return null;
- }
-
- public URL toVfsUrl() throws MalformedURLException, URISyntaxException
- {
- return null;
- }
-
- public URI toURI() throws URISyntaxException
- {
- return null;
- }
-
- public URL toURL() throws MalformedURLException, URISyntaxException
- {
- return null;
- }
-
- public long getLastModified() throws IOException
- {
- return 0;
- }
-
- public boolean hasBeenModified() throws IOException
- {
- return false;
- }
-
- public long getSize() throws IOException
- {
- return 0;
- }
-
- public boolean exists() throws IOException
- {
- return false;
- }
-
- public boolean isLeaf() throws IOException
- {
- return false;
- }
-
- public boolean isHidden() throws IOException
- {
- return false;
- }
-
- public String getLocalPathName()
- {
- return null;
- }
-
- public boolean isNested() throws IOException
- {
- return false;
- }
-
- public InputStream openStream() throws IOException
- {
- return null;
- }
-
- public VirtualFileHandler getParent() throws IOException
- {
- return null;
- }
-
- public List<VirtualFileHandler> getChildren(boolean ignoreErrors) throws IOException
- {
- return null;
- }
-
- public VirtualFileHandler getChild(String path) throws IOException
- {
- return null;
- }
-
- public VFSContext getVFSContext()
- {
- return null;
- }
-
- public VirtualFile getVirtualFile()
- {
- return null;
- }
-
- public void close()
- {
-
- }
-
- public void replaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
- {
-
- }
-
- public boolean removeChild(String name) throws IOException
- {
- return false;
- }
-
- public boolean delete(int gracePeriod) throws IOException
- {
- return false;
- }
-
- public URL getRealURL() throws IOException, URISyntaxException
- {
- return null;
- }
- };
- }
-
- public String getName()
- {
- return "somefile.bsh";
- }
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,250 @@
+/*
+* 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.deployers.vfs.structure.file.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.test.BaseTestCase;
+import org.jboss.test.deployers.vfs.structure.file.support.BshFileMatcher;
+import org.jboss.test.deployers.vfs.structure.file.support.TmpFileStructure;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.spi.VFSContext;
+import org.jboss.virtual.spi.VirtualFileHandler;
+
+/**
+ * FileMatcherTestCase.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class FileMatcherTestCase extends BaseTestCase
+{
+ public static Test suite()
+ {
+ return new TestSuite(FileMatcherTestCase.class);
+ }
+
+ public FileMatcherTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected VirtualFile getVirtualFile() throws Throwable
+ {
+ return new MyVirtualFile();
+ }
+
+ public void testMatcher() throws Throwable
+ {
+ BasicBootstrap bootstrap = new BasicBootstrap();
+ bootstrap.run();
+ Kernel kernel = bootstrap.getKernel();
+ KernelController controller = kernel.getController();
+ try
+ {
+ BeanMetaData fsMD = new AbstractBeanMetaData("fileStructure", TmpFileStructure.class.getName());
+ KernelControllerContext fsCC = controller.install(fsMD);
+ assertEquals(fsCC.getState(), ControllerState.INSTALLED);
+ TmpFileStructure fs = (TmpFileStructure)fsCC.getTarget();
+ assertNotNull(fs);
+
+ VirtualFile file = getVirtualFile();
+ assertFalse(fs.checkFileMatchers(file));
+
+ BeanMetaData fmMD = new AbstractBeanMetaData("bshFileMatcher", BshFileMatcher.class.getName());
+ controller.install(fmMD);
+
+ assertTrue(fs.checkFileMatchers(file));
+
+ controller.uninstall(fmMD.getName());
+
+ assertFalse(fs.checkFileMatchers(file));
+ }
+ finally
+ {
+ controller.shutdown();
+ }
+ }
+
+ private static class MyVirtualFile extends VirtualFile
+ {
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ public MyVirtualFile()
+ {
+ super(getVirtualFileHandler());
+ }
+
+ private static VirtualFileHandler getVirtualFileHandler()
+ {
+ return new VirtualFileHandler()
+ {
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public String getPathName()
+ {
+ return null;
+ }
+
+ public URL toVfsUrl() throws MalformedURLException, URISyntaxException
+ {
+ return null;
+ }
+
+ public URI toURI() throws URISyntaxException
+ {
+ return null;
+ }
+
+ public URL toURL() throws MalformedURLException, URISyntaxException
+ {
+ return null;
+ }
+
+ public long getLastModified() throws IOException
+ {
+ return 0;
+ }
+
+ public boolean hasBeenModified() throws IOException
+ {
+ return false;
+ }
+
+ public long getSize() throws IOException
+ {
+ return 0;
+ }
+
+ public boolean exists() throws IOException
+ {
+ return false;
+ }
+
+ public boolean isLeaf() throws IOException
+ {
+ return false;
+ }
+
+ public boolean isHidden() throws IOException
+ {
+ return false;
+ }
+
+ public String getLocalPathName()
+ {
+ return null;
+ }
+
+ public boolean isNested() throws IOException
+ {
+ return false;
+ }
+
+ public InputStream openStream() throws IOException
+ {
+ return null;
+ }
+
+ public VirtualFileHandler getParent() throws IOException
+ {
+ return null;
+ }
+
+ public List<VirtualFileHandler> getChildren(boolean ignoreErrors) throws IOException
+ {
+ return null;
+ }
+
+ public VirtualFileHandler getChild(String path) throws IOException
+ {
+ return null;
+ }
+
+ public VFSContext getVFSContext()
+ {
+ return null;
+ }
+
+ public VirtualFile getVirtualFile()
+ {
+ return null;
+ }
+
+ public void close()
+ {
+
+ }
+
+ public void replaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
+ {
+
+ }
+
+ public boolean removeChild(String name) throws IOException
+ {
+ return false;
+ }
+
+ public boolean delete(int gracePeriod) throws IOException
+ {
+ return false;
+ }
+
+ public URL getRealURL() throws IOException, URISyntaxException
+ {
+ return null;
+ }
+
+ public void cleanup()
+ {
+ }
+ };
+ }
+
+ public String getName()
+ {
+ return "somefile.bsh";
+ }
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,151 +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.deployers.vfs.structurebuilder.test;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.List;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.jboss.deployers.client.spi.DeploymentFactory;
-import org.jboss.deployers.spi.structure.ClassPathEntry;
-import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.structure.spi.DeploymentContext;
-import org.jboss.deployers.vfs.plugins.client.AbstractVFSDeployment;
-import org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder;
-import org.jboss.deployers.vfs.spi.client.VFSDeployment;
-import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
-import org.jboss.test.deployers.structure.structurebuilder.StructureBuilderTest;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * VFSStructureBuilderUnitTestCase.
- *
- * @author <a href="adrian at jboss.org">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public class VFSStructureBuilderUnitTestCase extends StructureBuilderTest
-{
- public static Test suite()
- {
- return new TestSuite(VFSStructureBuilderUnitTestCase.class);
- }
-
- public VFSStructureBuilderUnitTestCase(String name)
- {
- super(name);
- }
-
- protected VFSStructureBuilder getStructureBuilder()
- {
- return new VFSStructureBuilder();
- }
-
- protected VFSDeployment createDeployment()
- {
- URL url = getDeploymentURL();
- try
- {
- VirtualFile file = VFS.getRoot(url);
- return new AbstractVFSDeployment(file);
- }
- catch (IOException e)
- {
- throw new RuntimeException("Failed to get virtual file " + url + " for " + getName());
- }
- }
-
- protected DeploymentFactory getDeploymentFactory()
- {
- return VFSDeploymentFactory.getInstance();
- }
-
- protected String getDeploymentName()
- {
- return getDeploymentURL().toString();
- }
-
- protected URL getDeploymentURL()
- {
- String name = "/structurebuilder/predetermined/" + getName();
- URL url = getResource(name);
- if (url == null)
- fail("Unable to find resource: " + name);
- return url;
- }
-
- protected void checkContextInfo(DeploymentContext context, ContextInfo contextInfo) throws Exception
- {
- VFSDeploymentContext vfsContext = (VFSDeploymentContext) context;
- checkMetaDataLocation(vfsContext, contextInfo);
- checkClassPath(vfsContext, contextInfo);
- }
-
- protected void checkMetaDataLocation(VFSDeploymentContext context, ContextInfo contextInfo) throws Exception
- {
- List<String> metaDataPaths = contextInfo.getMetaDataPath();
- assertNotNull(metaDataPaths);
- List<VirtualFile> metaDataLocations = context.getMetaDataLocations();
- assertNotNull(metaDataLocations);
-
- if (metaDataPaths.isEmpty())
- assertEmpty(metaDataLocations);
- else
- {
- VirtualFile root = context.getRoot();
- VirtualFile expected = root.findChild(metaDataPaths.get(0));
- assertEquals(1, metaDataLocations.size());
- assertEquals(expected, metaDataLocations.get(0));
- }
- }
-
- protected void checkClassPath(VFSDeploymentContext context, ContextInfo contextInfo) throws Exception
- {
- List<ClassPathEntry> classPathEntries = contextInfo.getClassPath();
- List<VirtualFile> classPath = context.getClassPath();
-
- if (classPathEntries == null)
- assertNull(classPath);
- else
- {
- int cpeSize = classPathEntries.size();
- int cpSize = classPath != null ? classPath.size() : 0;
- assertTrue(cpeSize >= cpSize);
- for(int i = 0; i < cpeSize; i++)
- {
- ClassPathEntry entry = classPathEntries.get(i);
- VirtualFile file = (i < cpSize) ? classPath.get(i) : null;
- String path = entry.getPath();
- if ("".equals(path))
- assertTrue(file == null || "".equals(file.getPathName()));
- else
- {
- assertNotNull(file);
- assertEquals(path, file.getPathName());
- }
- }
- }
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,151 @@
+/*
+* 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.deployers.vfs.structurebuilder.test;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.deployers.client.spi.DeploymentFactory;
+import org.jboss.deployers.spi.structure.ClassPathEntry;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.vfs.plugins.client.AbstractVFSDeployment;
+import org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.test.deployers.structure.structurebuilder.StructureBuilderTest;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * VFSStructureBuilderUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class VFSStructureBuilderUnitTestCase extends StructureBuilderTest
+{
+ public static Test suite()
+ {
+ return new TestSuite(VFSStructureBuilderUnitTestCase.class);
+ }
+
+ public VFSStructureBuilderUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected VFSStructureBuilder getStructureBuilder()
+ {
+ return new VFSStructureBuilder();
+ }
+
+ protected VFSDeployment createDeployment()
+ {
+ URL url = getDeploymentURL();
+ try
+ {
+ VirtualFile file = VFS.getRoot(url);
+ return new AbstractVFSDeployment(file);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Failed to get virtual file " + url + " for " + getName());
+ }
+ }
+
+ protected DeploymentFactory getDeploymentFactory()
+ {
+ return VFSDeploymentFactory.getInstance();
+ }
+
+ protected String getDeploymentName()
+ {
+ return getDeploymentURL().toString();
+ }
+
+ protected URL getDeploymentURL()
+ {
+ String name = "/structurebuilder/predetermined/" + getName();
+ URL url = getResource(name);
+ if (url == null)
+ fail("Unable to find resource: " + name);
+ return url;
+ }
+
+ protected void checkContextInfo(DeploymentContext context, ContextInfo contextInfo) throws Exception
+ {
+ VFSDeploymentContext vfsContext = (VFSDeploymentContext) context;
+ checkMetaDataLocation(vfsContext, contextInfo);
+ checkClassPath(vfsContext, contextInfo);
+ }
+
+ protected void checkMetaDataLocation(VFSDeploymentContext context, ContextInfo contextInfo) throws Exception
+ {
+ List<String> metaDataPaths = contextInfo.getMetaDataPath();
+ assertNotNull(metaDataPaths);
+ List<VirtualFile> metaDataLocations = context.getMetaDataLocations();
+ assertNotNull(metaDataLocations);
+
+ if (metaDataPaths.isEmpty())
+ assertEmpty(metaDataLocations);
+ else
+ {
+ VirtualFile root = context.getRoot();
+ VirtualFile expected = root.findChild(metaDataPaths.get(0));
+ assertEquals(1, metaDataLocations.size());
+ assertEquals(expected, metaDataLocations.get(0));
+ }
+ }
+
+ protected void checkClassPath(VFSDeploymentContext context, ContextInfo contextInfo) throws Exception
+ {
+ List<ClassPathEntry> classPathEntries = contextInfo.getClassPath();
+ List<VirtualFile> classPath = context.getClassPath();
+
+ if (classPathEntries == null)
+ assertEmpty(classPath);
+ else
+ {
+ int cpeSize = classPathEntries.size();
+ int cpSize = classPath != null ? classPath.size() : 0;
+ assertTrue(cpeSize >= cpSize);
+ for(int i = 0; i < cpeSize; i++)
+ {
+ ClassPathEntry entry = classPathEntries.get(i);
+ VirtualFile file = (i < cpSize) ? classPath.get(i) : null;
+ String path = entry.getPath();
+ if ("".equals(path))
+ assertTrue(file == null || "".equals(file.getPathName()));
+ else
+ {
+ assertNotNull(file);
+ assertEquals(path, file.getPathName());
+ }
+ }
+ }
+ }
+}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor)
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,127 +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.deployers.vfs.webbeans.test;
-
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Iterator;
-import java.net.URL;
-
-import junit.framework.Test;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.test.deployers.vfs.webbeans.support.WebBeanDiscovery;
-import org.jboss.test.deployers.vfs.webbeans.support.crm.CrmWebBean;
-import org.jboss.test.deployers.vfs.webbeans.support.ejb.BusinessInterface;
-import org.jboss.test.deployers.vfs.webbeans.support.ejb.MySLSBean;
-import org.jboss.test.deployers.vfs.webbeans.support.ext.ExternalWebBean;
-import org.jboss.test.deployers.vfs.webbeans.support.jar.PlainJavaBean;
-import org.jboss.test.deployers.vfs.webbeans.support.ui.UIWebBean;
-import org.jboss.test.deployers.vfs.webbeans.support.web.ServletWebBean;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * WebBeanDiscoveryTestCase.
- *
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class WebBeanDiscoveryTestCase extends AbstractWebBeansTest
-{
- public WebBeanDiscoveryTestCase(String name)
- {
- super(name);
- }
-
- public static Test suite()
- {
- return suite(WebBeanDiscoveryTestCase.class);
- }
-
- public void testSimpleUsage() throws Exception
- {
- VirtualFile ear = createBasicEar();
- VFSDeploymentUnit topUnit = assertDeploy(ear);
- try
- {
- WebBeanDiscovery wbDiscovery = topUnit.getAttachment(WebBeanDiscovery.class);
- assertNotNull(wbDiscovery);
-
- Set<String> expected = new HashSet<String>();
- addExpectedClass(expected, "ejbs.jar");
- addExpectedClass(expected, "ext.jar");
- addExpectedClass(expected, "simple.jar");
- addExpectedClass(expected, "ui.jar");
- addExpectedClass(expected, "crm.jar");
- addExpectedClass(expected, "simple.war", "/WEB-INF/web-beans.xml");
-
- for (URL url : wbDiscovery.discoverWebBeansXml())
- {
- boolean found = false;
- Iterator<String> iter = expected.iterator();
- while (iter.hasNext())
- {
- String expectedURL = iter.next();
- if (url.toExternalForm().contains(expectedURL))
- {
- iter.remove();
- found = true;
- break;
- }
- }
- assertTrue("Unexpected wb url: " + url, found);
- }
-
- assertEmpty("Should be emtpy, missing " + expected, expected);
-
- addExpectedClass(expected, BusinessInterface.class);
- addExpectedClass(expected, MySLSBean.class);
- addExpectedClass(expected, ExternalWebBean.class);
- addExpectedClass(expected, PlainJavaBean.class);
- addExpectedClass(expected, UIWebBean.class);
- addExpectedClass(expected, ServletWebBean.class);
- addExpectedClass(expected, CrmWebBean.class);
-
- for (Class<?> clazz : wbDiscovery.discoverWebBeanClasses())
- assertTrue(expected.remove(clazz.getName()));
-
- assertEmpty("Should be emtpy, missing " + expected, expected);
- }
- finally
- {
- undeploy(topUnit);
- }
- }
-
- private static void addExpectedClass(Set<String> expected, String unit)
- {
- addExpectedClass(expected, unit, "/META-INF/web-beans.xml");
- }
-
- private static void addExpectedClass(Set<String> expected, String unit, String suffix)
- {
- expected.add(unit + suffix);
- }
-
- private static void addExpectedClass(Set<String> expected, Class<?> clazz)
- {
- expected.add(clazz.getName());
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,127 @@
+/*
+ * 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.deployers.vfs.webbeans.test;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Iterator;
+import java.net.URL;
+
+import junit.framework.Test;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.test.deployers.vfs.webbeans.support.WebBeanDiscovery;
+import org.jboss.test.deployers.vfs.webbeans.support.crm.CrmWebBean;
+import org.jboss.test.deployers.vfs.webbeans.support.ejb.BusinessInterface;
+import org.jboss.test.deployers.vfs.webbeans.support.ejb.MySLSBean;
+import org.jboss.test.deployers.vfs.webbeans.support.ext.ExternalWebBean;
+import org.jboss.test.deployers.vfs.webbeans.support.jar.PlainJavaBean;
+import org.jboss.test.deployers.vfs.webbeans.support.ui.UIWebBean;
+import org.jboss.test.deployers.vfs.webbeans.support.web.ServletWebBean;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * WebBeanDiscoveryTestCase.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class WebBeanDiscoveryTestCase extends AbstractWebBeansTest
+{
+ public WebBeanDiscoveryTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(WebBeanDiscoveryTestCase.class);
+ }
+
+ public void testSimpleUsage() throws Exception
+ {
+ VirtualFile ear = createBasicEar();
+ VFSDeploymentUnit topUnit = assertDeploy(ear);
+ try
+ {
+ WebBeanDiscovery wbDiscovery = topUnit.getAttachment(WebBeanDiscovery.class);
+ assertNotNull(wbDiscovery);
+
+ Set<String> expected = new HashSet<String>();
+ addExpectedResouorce(expected, "ejbs.jar");
+ addExpectedResouorce(expected, "ext.jar");
+ addExpectedResouorce(expected, "simple.jar");
+ addExpectedResouorce(expected, "ui.jar");
+ addExpectedResouorce(expected, "crm.jar");
+ addExpectedResource(expected, "simple.war", "/WEB-INF/web-beans.xml");
+
+ for (URL url : wbDiscovery.discoverWebBeansXml())
+ {
+ boolean found = false;
+ Iterator<String> iter = expected.iterator();
+ while (iter.hasNext())
+ {
+ String expectedURL = iter.next();
+ if (url.toExternalForm().contains(expectedURL))
+ {
+ iter.remove();
+ found = true;
+ break;
+ }
+ }
+ assertTrue("Unexpected wb url: " + url, found);
+ }
+
+ assertEmpty("Should be emtpy, missing " + expected, expected);
+
+ addExpectedClass(expected, BusinessInterface.class);
+ addExpectedClass(expected, MySLSBean.class);
+ addExpectedClass(expected, ExternalWebBean.class);
+ addExpectedClass(expected, PlainJavaBean.class);
+ addExpectedClass(expected, UIWebBean.class);
+ addExpectedClass(expected, ServletWebBean.class);
+ addExpectedClass(expected, CrmWebBean.class);
+
+ for (Class<?> clazz : wbDiscovery.discoverWebBeanClasses())
+ assertTrue(expected.remove(clazz.getName()));
+
+ assertEmpty("Should be emtpy, missing " + expected, expected);
+ }
+ finally
+ {
+ undeploy(topUnit);
+ }
+ }
+
+ private static void addExpectedResouorce(Set<String> expected, String unit)
+ {
+ addExpectedResource(expected, unit, "/META-INF/web-beans.xml");
+ }
+
+ private static void addExpectedResource(Set<String> expected, String unit, String suffix)
+ {
+ expected.add(unit + suffix);
+ }
+
+ private static void addExpectedClass(Set<String> expected, Class<?> clazz)
+ {
+ expected.add(clazz.getName());
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/resources/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.class
===================================================================
(Binary files differ)
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/resources/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.class (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.class)
===================================================================
(Binary files differ)
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs/src/test/resources/structureprocessor (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor)
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/pom.xml 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,76 +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.deployers</groupId>
- <artifactId>jboss-deployers</artifactId>
- <version>2.0.4-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- <packaging>jar</packaging>
- <name>JBoss Deployers VFS SPI</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Deployers VFS SPI</description>
-
- <!-- Do not add version information here, use ../pom.xml instead -->
- <dependencies>
- <!-- Global dependencies -->
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.cl</groupId>
- <artifactId>jboss-classloading</artifactId>
- <exclusions>
- <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.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-reflect</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>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </dependency>
- </dependencies>
-</project>
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/pom.xml (from rev 83489, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/pom.xml)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/pom.xml (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,76 @@
+<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.deployers</groupId>
+ <artifactId>jboss-deployers</artifactId>
+ <version>2.0.4.GA</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Deployers VFS SPI</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Deployers VFS SPI</description>
+
+ <!-- Do not add version information here, use ../pom.xml instead -->
+ <dependencies>
+ <!-- Global dependencies -->
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cl</groupId>
+ <artifactId>jboss-classloading</artifactId>
+ <exclusions>
+ <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.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</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>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,322 +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.deployers.vfs.spi.structure;
-
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Collections;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.spi.structure.StructureMetaData;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * StructureContext.
- *
- * @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 $
- */
-public class StructureContext
-{
- /** The root of the deployment */
- private VirtualFile root;
-
- /** The parent virtual file */
- private VirtualFile parent;
-
- /** The current candidate file */
- private VirtualFile file;
-
- /** The structure metadata */
- private StructureMetaData metaData;
-
- /** The structural deployers */
- private VFSStructuralDeployers deployers;
-
- /** The parent structure context */
- private StructureContext parentContext;
-
- /** The candidate annotation scanning */
- private boolean candidateAnnotationScanning;
-
- /** The callbacks */
- private Set<Object> callbacks;
-
- /**
- * Helper method to check parent is not null before retrieving parameters
- *
- * @param parentContext the parent context
- * @return the root
- * @throws IllegalArgumentException for a null parent
- */
- private static VirtualFile getRoot(StructureContext parentContext)
- {
- if (parentContext == null)
- throw new IllegalArgumentException("Null parentContext");
- return parentContext.getRoot();
- }
-
- /**
- * Create a new structure context from a root
- *
- * @param root the root file
- * @param parent the parent file
- * @param file the current file
- * @param metaData the structure metadata to build
- * @param deployers the available structure deployers
- * @param parentContext the parentContext
- * @throws IllegalArgumentException for a null parameter (parents can be null)
- */
- public StructureContext(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers, StructureContext parentContext)
- {
- if (root == null)
- throw new IllegalArgumentException("Null root");
- if (file == null)
- throw new IllegalArgumentException("Null file");
- if (metaData == null)
- throw new IllegalArgumentException("Null structure metadata");
- if (deployers == null)
- throw new IllegalArgumentException("Null structural deployers");
-
- this.root = root;
- this.parent = parent;
- this.file = file;
- this.metaData = metaData;
- this.deployers = deployers;
- this.parentContext = parentContext;
- }
-
- /**
- * Create a new structure context from a root
- *
- * @param root the root file
- * @param metaData the structure metadata to build
- * @param deployers the available structure deployers
- * @throws IllegalArgumentException for a null parameter
- */
- public StructureContext(VirtualFile root, StructureMetaData metaData, VFSStructuralDeployers deployers)
- {
- this(root, null, root, metaData, deployers, null);
- }
-
- /**
- * Create a new child structure context
- *
- * @param file the candidate file
- * @param metaData the structure metadata to build
- * @param parentContext the parentContext
- * @throws IllegalArgumentException for a null parameter
- */
- public StructureContext(VirtualFile file, StructureMetaData metaData, StructureContext parentContext)
- {
- this(getRoot(parentContext), parentContext.getFile(), file, metaData, parentContext.getDeployers(), parentContext);
- }
-
- /**
- * Get the file name
- *
- * @return the file name
- */
- public String getName()
- {
- return file.getName();
- }
-
- /**
- * Get the root.
- *
- * @return the root.
- */
- public VirtualFile getRoot()
- {
- return root;
- }
-
- /**
- * Get the parent.
- *
- * @return the parent.
- */
- public VirtualFile getParent()
- {
- return parent;
- }
-
- /**
- * Whether this is top level.
- *
- * @return true for top level.
- */
- public boolean isTopLevel()
- {
- return parent == null;
- }
-
- /**
- * Get the file.
- *
- * @return the file.
- */
- public VirtualFile getFile()
- {
- return file;
- }
-
- /**
- * Get the metaData.
- *
- * @return the metaData.
- */
- public StructureMetaData getMetaData()
- {
- return metaData;
- }
-
- /**
- * Get the deployers.
- *
- * @return the deployers.
- */
- public VFSStructuralDeployers getDeployers()
- {
- return deployers;
- }
-
- /**
- * Get the parentContext.
- *
- * @return the parentContext.
- */
- public StructureContext getParentContext()
- {
- return parentContext;
- }
-
- /**
- * Get the candidate annotation scanning.
- *
- * @return the candidate annotation scanning
- */
- public boolean isCandidateAnnotationScanning()
- {
- return candidateAnnotationScanning;
- }
-
- /**
- * Set the candidate annotation scanning.
- *
- * @param candidateAnnotationScanning the candidate annotation scanning
- */
- public void setCandidateAnnotationScanning(boolean candidateAnnotationScanning)
- {
- this.candidateAnnotationScanning = candidateAnnotationScanning;
- }
-
- /***
- * Get the matching callbacks.
- *
- * @param <T> exact callback type
- * @param callbackType the exact callback type
- * @return the callbacks
- */
- public <T> Set<T> getCallbacks(Class<T> callbackType)
- {
- if (callbackType == null)
- throw new IllegalArgumentException("Null callback type");
-
- if (callbacks == null || callbacks.isEmpty())
- return Collections.emptySet();
-
- Set<T> set = new HashSet<T>();
- for (Object callback : callbacks)
- {
- if (callbackType.isInstance(callback))
- set.add(callbackType.cast(callback));
- }
- return set;
- }
-
- /**
- * Add the callback.
- *
- * @param callback the callback
- */
- public void addCallback(Object callback)
- {
- if (callbacks == null)
- callbacks = new HashSet<Object>();
- callbacks.add(callback);
- }
-
- /**
- * Set the callbacks.
- *
- * @param callbacks the callbacks
- */
- public void setCallbacks(Set<Object> callbacks)
- {
- this.callbacks = callbacks;
- }
-
- /**
- * Determine the child structure
- *
- * @param child the child
- * @return true when recognised
- * @throws DeploymentException for any error
- */
- public boolean determineChildStructure(VirtualFile child) throws DeploymentException
- {
- if (child == null)
- throw new IllegalArgumentException("Null child");
-
- return getDeployers().determineStructure(child, this);
- }
-
- /**
- * Add a child context
- *
- * @param child the child
- */
- public void addChild(ContextInfo child)
- {
- if (child == null)
- throw new IllegalArgumentException("Null child");
-
- getMetaData().addContext(child);
- }
-
- /**
- * Remove a child context
- *
- * @param child the child
- */
- public void removeChild(ContextInfo child)
- {
- if (child == null)
- throw new IllegalArgumentException("Null child");
-
- getMetaData().removeContext(child);
- }
-}
\ No newline at end of file
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,322 @@
+/*
+* 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.deployers.vfs.spi.structure;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * StructureContext.
+ *
+ * @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 $
+ */
+public class StructureContext
+{
+ /** The root of the deployment */
+ private VirtualFile root;
+
+ /** The parent virtual file */
+ private VirtualFile parent;
+
+ /** The current candidate file */
+ private VirtualFile file;
+
+ /** The structure metadata */
+ private StructureMetaData metaData;
+
+ /** The structural deployers */
+ private VFSStructuralDeployers deployers;
+
+ /** The parent structure context */
+ private StructureContext parentContext;
+
+ /** The candidate annotation scanning */
+ private boolean candidateAnnotationScanning;
+
+ /** The callbacks */
+ private Set<Object> callbacks;
+
+ /**
+ * Helper method to check parent is not null before retrieving parameters
+ *
+ * @param parentContext the parent context
+ * @return the root
+ * @throws IllegalArgumentException for a null parent
+ */
+ private static VirtualFile getRoot(StructureContext parentContext)
+ {
+ if (parentContext == null)
+ throw new IllegalArgumentException("Null parentContext");
+ return parentContext.getRoot();
+ }
+
+ /**
+ * Create a new structure context from a root
+ *
+ * @param root the root file
+ * @param parent the parent file
+ * @param file the current file
+ * @param metaData the structure metadata to build
+ * @param deployers the available structure deployers
+ * @param parentContext the parentContext
+ * @throws IllegalArgumentException for a null parameter (parents can be null)
+ */
+ public StructureContext(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers, StructureContext parentContext)
+ {
+ if (root == null)
+ throw new IllegalArgumentException("Null root");
+ if (file == null)
+ throw new IllegalArgumentException("Null file");
+ if (metaData == null)
+ throw new IllegalArgumentException("Null structure metadata");
+ if (deployers == null)
+ throw new IllegalArgumentException("Null structural deployers");
+
+ this.root = root;
+ this.parent = parent;
+ this.file = file;
+ this.metaData = metaData;
+ this.deployers = deployers;
+ this.parentContext = parentContext;
+ }
+
+ /**
+ * Create a new structure context from a root
+ *
+ * @param root the root file
+ * @param metaData the structure metadata to build
+ * @param deployers the available structure deployers
+ * @throws IllegalArgumentException for a null parameter
+ */
+ public StructureContext(VirtualFile root, StructureMetaData metaData, VFSStructuralDeployers deployers)
+ {
+ this(root, null, root, metaData, deployers, null);
+ }
+
+ /**
+ * Create a new child structure context
+ *
+ * @param file the candidate file
+ * @param metaData the structure metadata to build
+ * @param parentContext the parentContext
+ * @throws IllegalArgumentException for a null parameter
+ */
+ public StructureContext(VirtualFile file, StructureMetaData metaData, StructureContext parentContext)
+ {
+ this(getRoot(parentContext), parentContext.getFile(), file, metaData, parentContext.getDeployers(), parentContext);
+ }
+
+ /**
+ * Get the file name
+ *
+ * @return the file name
+ */
+ public String getName()
+ {
+ return file.getName();
+ }
+
+ /**
+ * Get the root.
+ *
+ * @return the root.
+ */
+ public VirtualFile getRoot()
+ {
+ return root;
+ }
+
+ /**
+ * Get the parent.
+ *
+ * @return the parent.
+ */
+ public VirtualFile getParent()
+ {
+ return parent;
+ }
+
+ /**
+ * Whether this is top level.
+ *
+ * @return true for top level.
+ */
+ public boolean isTopLevel()
+ {
+ return parent == null;
+ }
+
+ /**
+ * Get the file.
+ *
+ * @return the file.
+ */
+ public VirtualFile getFile()
+ {
+ return file;
+ }
+
+ /**
+ * Get the metaData.
+ *
+ * @return the metaData.
+ */
+ public StructureMetaData getMetaData()
+ {
+ return metaData;
+ }
+
+ /**
+ * Get the deployers.
+ *
+ * @return the deployers.
+ */
+ public VFSStructuralDeployers getDeployers()
+ {
+ return deployers;
+ }
+
+ /**
+ * Get the parentContext.
+ *
+ * @return the parentContext.
+ */
+ public StructureContext getParentContext()
+ {
+ return parentContext;
+ }
+
+ /**
+ * Get the candidate annotation scanning.
+ *
+ * @return the candidate annotation scanning
+ */
+ public boolean isCandidateAnnotationScanning()
+ {
+ return candidateAnnotationScanning;
+ }
+
+ /**
+ * Set the candidate annotation scanning.
+ *
+ * @param candidateAnnotationScanning the candidate annotation scanning
+ */
+ public void setCandidateAnnotationScanning(boolean candidateAnnotationScanning)
+ {
+ this.candidateAnnotationScanning = candidateAnnotationScanning;
+ }
+
+ /***
+ * Get the matching callbacks.
+ *
+ * @param <T> exact callback type
+ * @param callbackType the exact callback type
+ * @return the callbacks
+ */
+ public <T> Set<T> getCallbacks(Class<T> callbackType)
+ {
+ if (callbackType == null)
+ throw new IllegalArgumentException("Null callback type");
+
+ if (callbacks == null || callbacks.isEmpty())
+ return Collections.emptySet();
+
+ Set<T> set = new HashSet<T>();
+ for (Object callback : callbacks)
+ {
+ if (callbackType.isInstance(callback))
+ set.add(callbackType.cast(callback));
+ }
+ return set;
+ }
+
+ /**
+ * Add the callback.
+ *
+ * @param callback the callback
+ */
+ public void addCallback(Object callback)
+ {
+ if (callbacks == null)
+ callbacks = new HashSet<Object>();
+ callbacks.add(callback);
+ }
+
+ /**
+ * Set the callbacks.
+ *
+ * @param callbacks the callbacks
+ */
+ public void setCallbacks(Set<Object> callbacks)
+ {
+ this.callbacks = callbacks;
+ }
+
+ /**
+ * Determine the child structure
+ *
+ * @param child the child
+ * @return true when recognised
+ * @throws DeploymentException for any error
+ */
+ public boolean determineChildStructure(VirtualFile child) throws DeploymentException
+ {
+ if (child == null)
+ throw new IllegalArgumentException("Null child");
+
+ return getDeployers().determineStructure(child, this);
+ }
+
+ /**
+ * Add a child context
+ *
+ * @param child the child
+ */
+ public void addChild(ContextInfo child)
+ {
+ if (child == null)
+ throw new IllegalArgumentException("Null child");
+
+ getMetaData().addContext(child);
+ }
+
+ /**
+ * Remove a child context
+ *
+ * @param child the child
+ */
+ public void removeChild(ContextInfo child)
+ {
+ if (child == null)
+ throw new IllegalArgumentException("Null child");
+
+ getMetaData().removeContext(child);
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,148 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, 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.deployers.vfs.spi.structure;
-
-import java.util.List;
-
-import org.jboss.deployers.structure.spi.DeploymentContext;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * VFSDeploymentContext.
- *
- * @author <a href="adrian at jboss.org">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public interface VFSDeploymentContext extends DeploymentContext
-{
- /**
- * Get the root file
- *
- * @return the root
- */
- VirtualFile getRoot();
-
- /**
- * Set the meta data path relative to the root
- *
- * @param paths the path
- */
- void setMetaDataPath(List<String> paths);
-
- /**
- * Get the meta data locations
- *
- * @return the meta data locations
- */
- List<VirtualFile> getMetaDataLocations();
-
- /**
- * Set the meta data locations
- *
- * @param locations the meta data location
- */
- void setMetaDataLocations(List<VirtualFile> locations);
-
- /**
- * Gets a metadata file
- *
- * @param name the name to exactly match
- * @return the virtual file or null if not found
- * @throws IllegalArgumentException for a null name
- */
- VirtualFile getMetaDataFile(String name);
-
- /**
- * Gets metadata files for this deployment
- *
- * @param name the name to exactly match
- * @param suffix the suffix to partially match
- * @return the virtual files that match
- * @throws IllegalArgumentException if both the name and suffix are null
- */
- List<VirtualFile> getMetaDataFiles(String name, String suffix);
-
- /**
- * Gets a file from this deployment
- *
- * @param name the name to exactly match
- * @return the file or null if not found
- * @throws IllegalArgumentException if both the name
- */
- VirtualFile getFile(String name);
-
- /**
- * Get the class path
- *
- * @return the class path
- */
- List<VirtualFile> getClassPath();
-
- /**
- * Set the class path
- *
- * @param paths the paths
- */
- void setClassPath(List<VirtualFile> paths);
-
- /**
- * Prepend virtual files to the classpath
- *
- * @param files a virtual file
- */
- void prependClassPath(VirtualFile... files);
-
- /**
- * Prepend virtual files to the classpath
- *
- * @param files a virtual file
- */
- void prependClassPath(List<VirtualFile> files);
-
- /**
- * Append virtual files to the classpath
- *
- * @param files a virtual file
- */
- void appendClassPath(VirtualFile... files);
-
- /**
- * Add virtual files to the classpath
- *
- * @param files a virtual file
- */
- void appendClassPath(List<VirtualFile> files);
-
- /**
- * Get the top level deployment context
- *
- * @return the top level deployment context
- */
- VFSDeploymentContext getTopLevel();
-
- /**
- * Get a resource loader
- *
- * @return the resource loader
- */
- VFSDeploymentResourceLoader getResourceLoader();
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,177 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.deployers.vfs.spi.structure;
+
+import java.util.List;
+
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * VFSDeploymentContext.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
+ * @version $Revision: 1.1 $
+ */
+public interface VFSDeploymentContext extends DeploymentContext
+{
+ /**
+ * Get the root file
+ *
+ * @return the root
+ */
+ VirtualFile getRoot();
+
+ /**
+ * Set the meta data path relative to the root
+ *
+ * @param paths the path
+ */
+ void setMetaDataPath(List<String> paths);
+
+ /**
+ * Get the meta data locations
+ *
+ * @return the meta data locations
+ */
+ List<VirtualFile> getMetaDataLocations();
+
+ /**
+ * Set the meta data locations
+ *
+ * @param locations the meta data location
+ */
+ void setMetaDataLocations(List<VirtualFile> locations);
+
+ /**
+ * Gets a metadata file
+ *
+ * @param name the name to exactly match
+ * @return the virtual file or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ VirtualFile getMetaDataFile(String name);
+
+ /**
+ * Gets metadata files for this deployment
+ *
+ * @param name the name to exactly match
+ * @param suffix the suffix to partially match
+ * @return the virtual files that match
+ * @throws IllegalArgumentException if both the name and suffix are null
+ */
+ List<VirtualFile> getMetaDataFiles(String name, String suffix);
+
+ /**
+ * Prepend metadata file locations.
+ *
+ * @param locations the locations
+ */
+ void prependMetaDataLocation(VirtualFile... locations);
+
+ /**
+ * Append metadata file locations.
+ *
+ * @param locations the locations
+ */
+ void appendMetaDataLocation(VirtualFile... locations);
+
+ /**
+ * Remove metadata file locations.
+ *
+ * @param locations the locations
+ */
+ void removeMetaDataLocation(VirtualFile... locations);
+
+ /**
+ * Gets a file from this deployment
+ *
+ * @param name the name to exactly match
+ * @return the file or null if not found
+ * @throws IllegalArgumentException if both the name
+ */
+ VirtualFile getFile(String name);
+
+ /**
+ * Get the class path
+ *
+ * @return the class path
+ */
+ List<VirtualFile> getClassPath();
+
+ /**
+ * Set the class path
+ *
+ * @param paths the paths
+ */
+ void setClassPath(List<VirtualFile> paths);
+
+ /**
+ * Prepend virtual files to the classpath
+ *
+ * @param files a virtual file
+ */
+ void prependClassPath(VirtualFile... files);
+
+ /**
+ * Prepend virtual files to the classpath
+ *
+ * @param files a virtual file
+ */
+ void prependClassPath(List<VirtualFile> files);
+
+ /**
+ * Append virtual files to the classpath
+ *
+ * @param files a virtual file
+ */
+ void appendClassPath(VirtualFile... files);
+
+ /**
+ * Add virtual files to the classpath
+ *
+ * @param files a virtual file
+ */
+ void appendClassPath(List<VirtualFile> files);
+
+ /**
+ * Remove classpath files.
+ *
+ * @param files the files
+ */
+ void removeClassPath(VirtualFile... files);
+
+ /**
+ * Get the top level deployment context
+ *
+ * @return the top level deployment context
+ */
+ VFSDeploymentContext getTopLevel();
+
+ /**
+ * Get a resource loader
+ *
+ * @return the resource loader
+ */
+ VFSDeploymentResourceLoader getResourceLoader();
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,155 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, 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.deployers.vfs.spi.structure;
-
-import java.util.List;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * VFSDeploymentUnit.
- *
- * @author <a href="adrian at jboss.org">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public interface VFSDeploymentUnit extends DeploymentUnit
-{
- /**
- * Gets a metadata file. This is a file located under the deployment metadata
- * context(s).
- *
- * @param name the name to exactly match
- * @return the virtual file or null if not found
- * @throws IllegalArgumentException for a null name
- */
- VirtualFile getMetaDataFile(String name);
-
- /**
- * Gets the metadata files for this deployment unit
- *
- * @param name the name to exactly match
- * @param suffix the suffix to partially match
- * @return the virtual files that match
- * @throws IllegalArgumentException if both the name and suffix are null
- */
- List<VirtualFile> getMetaDataFiles(String name, String suffix);
-
- /**
- * Get a resource loader
- *
- * @return the resource loader
- */
- VFSDeploymentResourceLoader getResourceLoader();
-
- /**
- * Get a virtual file
- *
- * @param path the relative path of the file
- * @return the virtual file or null if not found
- */
- VirtualFile getFile(String path);
-
- /**
- * Get the root
- *
- * @return the root
- */
- VirtualFile getRoot();
-
- /**
- * Get the class path
- *
- * @return the class path
- */
- List<VirtualFile> getClassPath();
-
- /**
- * Set the classpath
- *
- * @param classPath the classpath
- */
- void setClassPath(List<VirtualFile> classPath);
-
- /**
- * Prepend virtual files to the classpath
- *
- * @param files a virtual file
- */
- void prependClassPath(VirtualFile... files);
-
- /**
- * Prepend virtual files to the classpath
- *
- * @param files a virtual file
- */
- void prependClassPath(List<VirtualFile> files);
-
- /**
- * Append virtual files to the classpath
- *
- * @param files a virtual file
- */
- void appendClassPath(VirtualFile... files);
-
- /**
- * Add virtual files to the classpath
- *
- * @param files a virtual file
- */
- void appendClassPath(List<VirtualFile> files);
-
- /**
- * Append virtual files to the classpath
- *
- * @param files a virtual file
- */
- void addClassPath(VirtualFile... files);
-
- /**
- * Add virtual files to the classpath
- *
- * @param files a virtual file
- */
- void addClassPath(List<VirtualFile> files);
-
- /**
- * Get the top leve deployment unit
- *
- * @return the top level deployment unit
- */
- VFSDeploymentUnit getTopLevel();
-
- /**
- * Get the parent deployment unit
- *
- * @return the parent or null if there is no parent
- */
- VFSDeploymentUnit getParent();
-
- /**
- * Get the children
- *
- * @return the children
- */
- List<VFSDeploymentUnit> getVFSChildren();
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,186 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.deployers.vfs.spi.structure;
+
+import java.util.List;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * VFSDeploymentUnit.
+ *
+ * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
+ * @version $Revision: 1.1 $
+ */
+public interface VFSDeploymentUnit extends DeploymentUnit
+{
+ /**
+ * Gets a metadata file. This is a file located under the deployment metadata
+ * context(s).
+ *
+ * @param name the name to exactly match
+ * @return the virtual file or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ VirtualFile getMetaDataFile(String name);
+
+ /**
+ * Gets the metadata files for this deployment unit
+ *
+ * @param name the name to exactly match
+ * @param suffix the suffix to partially match
+ * @return the virtual files that match
+ * @throws IllegalArgumentException if both the name and suffix are null
+ */
+ List<VirtualFile> getMetaDataFiles(String name, String suffix);
+
+ /**
+ * Prepend metadata file locations.
+ *
+ * @param locations the locations
+ */
+ void prependMetaDataLocation(VirtualFile... locations);
+
+ /**
+ * Append metadata file locations.
+ *
+ * @param locations the locations
+ */
+ void appendMetaDataLocation(VirtualFile... locations);
+
+ /**
+ * Remove metadata file locations.
+ *
+ * @param locations the locations
+ */
+ void removeMetaDataLocation(VirtualFile... locations);
+
+ /**
+ * Get a resource loader
+ *
+ * @return the resource loader
+ */
+ VFSDeploymentResourceLoader getResourceLoader();
+
+ /**
+ * Get a virtual file
+ *
+ * @param path the relative path of the file
+ * @return the virtual file or null if not found
+ */
+ VirtualFile getFile(String path);
+
+ /**
+ * Get the root
+ *
+ * @return the root
+ */
+ VirtualFile getRoot();
+
+ /**
+ * Get the class path
+ *
+ * @return the class path
+ */
+ List<VirtualFile> getClassPath();
+
+ /**
+ * Set the classpath
+ *
+ * @param classPath the classpath
+ * @deprecated user view should not have setters
+ */
+ @Deprecated
+ void setClassPath(List<VirtualFile> classPath);
+
+ /**
+ * Prepend virtual files to the classpath
+ *
+ * @param files a virtual file
+ */
+ void prependClassPath(VirtualFile... files);
+
+ /**
+ * Prepend virtual files to the classpath
+ *
+ * @param files a virtual file
+ */
+ void prependClassPath(List<VirtualFile> files);
+
+ /**
+ * Append virtual files to the classpath
+ *
+ * @param files a virtual file
+ */
+ void appendClassPath(VirtualFile... files);
+
+ /**
+ * Add virtual files to the classpath
+ *
+ * @param files a virtual file
+ */
+ void appendClassPath(List<VirtualFile> files);
+
+ /**
+ * Append virtual files to the classpath
+ *
+ * @param files a virtual file
+ */
+ void addClassPath(VirtualFile... files);
+
+ /**
+ * Add virtual files to the classpath
+ *
+ * @param files a virtual file
+ */
+ void addClassPath(List<VirtualFile> files);
+
+ /**
+ * Remove classpath files.
+ *
+ * @param files the files
+ */
+ void removeClassPath(VirtualFile... files);
+
+ /**
+ * Get the top leve deployment unit
+ *
+ * @return the top level deployment unit
+ */
+ VFSDeploymentUnit getTopLevel();
+
+ /**
+ * Get the parent deployment unit
+ *
+ * @return the parent or null if there is no parent
+ */
+ VFSDeploymentUnit getParent();
+
+ /**
+ * Get the children
+ *
+ * @return the children
+ */
+ List<VFSDeploymentUnit> getVFSChildren();
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,531 +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.deployers.vfs.spi.structure.helpers;
-
-import java.io.IOException;
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.jboss.deployers.spi.annotations.AnnotationEnvironment;
-import org.jboss.deployers.spi.structure.ClassPathEntry;
-import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.spi.structure.StructureMetaData;
-import org.jboss.deployers.spi.structure.StructureMetaDataFactory;
-import org.jboss.deployers.vfs.spi.structure.CandidateAnnotationsCallback;
-import org.jboss.deployers.vfs.spi.structure.StructureContext;
-import org.jboss.deployers.vfs.spi.structure.StructureDeployer;
-import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
-import org.jboss.logging.Logger;
-import org.jboss.util.collection.CollectionsFactory;
-import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileVisitor;
-import org.jboss.virtual.VisitorAttributes;
-
-/**
- * AbstractStructureDeployer.<p>
- *
- * We don't care about the order by default.
- *
- * @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 $
- */
-public abstract class AbstractStructureDeployer implements StructureDeployer
-{
- /** The log */
- protected Logger log = Logger.getLogger(getClass());
-
- /** The relative order */
- private int relativeOrder = Integer.MAX_VALUE;
-
- /** The candidate structure visitor factory */
- private CandidateStructureVisitorFactory candidateStructureVisitorFactory = DefaultCandidateStructureVisitorFactory.INSTANCE;
-
- /** The context info order */
- private Integer contextInfoOrder;
-
- /** The supports annotations flag */
- private boolean supportsCandidateAnnotations;
-
- /** The candidate annotations */
- private Set<Class<? extends Annotation>> candidateAnnotations;
-
- /**
- * Get the relative path between two virtual files
- *
- * @param context the structure context
- * @param child the child
- * @return the relative path
- */
- public static final String getRelativePath(StructureContext context, VirtualFile child)
- {
- if (context == null)
- throw new IllegalArgumentException("Null context");
-
- return getRelativePath(context.getParent(), child);
- }
-
- /**
- * Get the relative path between two virtual files
- *
- * @param parent the parent
- * @param child the child
- * @return the relative path
- */
- public static final String getRelativePath(VirtualFile parent, VirtualFile child)
- {
- if (child == null)
- throw new IllegalArgumentException("Null child");
-
- String childPath = child.getPathName();
- if (parent != null)
- {
- String parentPath = parent.getPathName();
-
- if (parentPath.length() == childPath.length())
- return "";
-
- // Not sure about this? It is obviously not a direct child if it is shorter?
- if (parentPath.length() < childPath.length())
- {
- if (parentPath.endsWith("/") == false)
- parentPath = parentPath + "/";
- if (childPath.startsWith(parentPath))
- return childPath.substring(parentPath.length());
- }
- }
-
- if (childPath.endsWith("/"))
- childPath = childPath.substring(0, childPath.length()-1);
-
- return childPath;
- }
-
- public int getRelativeOrder()
- {
- return relativeOrder;
- }
-
- public void setRelativeOrder(int order)
- {
- this.relativeOrder = order;
- }
-
- public void setContextInfoOrder(Integer contextInfoOrder)
- {
- this.contextInfoOrder = contextInfoOrder;
- }
-
- /**
- * Get the candidate annotations.
- *
- * @return the candidate annotations
- */
- public Set<Class<? extends Annotation>> getCandidateAnnotations()
- {
- return candidateAnnotations;
- }
-
- /**
- * Set the candidate annotations.
- *
- * @param candidateAnnotations the candidate annotations
- */
- public void setCandidateAnnotations(Set<Class<? extends Annotation>> candidateAnnotations)
- {
- this.candidateAnnotations = candidateAnnotations;
- }
-
- /**
- * Add candidate annotation.
- *
- * @param annotationClass the candidate annotation class
- */
- public void addCandidateAnnotation(Class<? extends Annotation> annotationClass)
- {
- if (candidateAnnotations == null)
- candidateAnnotations = new LinkedHashSet<Class<? extends Annotation>>();
- candidateAnnotations.add(annotationClass);
- }
-
- public boolean isSupportsCandidateAnnotations()
- {
- return supportsCandidateAnnotations;
- }
-
- /**
- * Set supportsCandidateAnnotations flag.
- *
- * @param supportsCandidateAnnotations the support candidate annotations flag
- */
- public void setSupportsCandidateAnnotations(boolean supportsCandidateAnnotations)
- {
- this.supportsCandidateAnnotations = supportsCandidateAnnotations;
- }
-
- /**
- * Get the candidateStructureVisitorFactory.
- *
- * @return the candidateStructureVisitorFactory.
- */
- public CandidateStructureVisitorFactory getCandidateStructureVisitorFactory()
- {
- return candidateStructureVisitorFactory;
- }
-
- /**
- * Set the candidateStructureVisitorFactory.
- *
- * @param candidateStructureVisitorFactory the candidateStructureVisitorFactory.
- * @throws IllegalArgumentException for a null candidate structure
- */
- public void setCandidateStructureVisitorFactory(CandidateStructureVisitorFactory candidateStructureVisitorFactory)
- {
- if (candidateStructureVisitorFactory == null)
- throw new IllegalArgumentException("Null candidateStructureVisitorFactory");
- this.candidateStructureVisitorFactory = candidateStructureVisitorFactory;
- }
-
- /**
- * Add an entry to the context classpath.
- *
- * @param structureContext - the structure context
- * @param entry - the candidate file to add as a classpath entry
- * @param includeEntry - a flag indicating if the entry should be added to
- * the classpath
- * @param includeRootManifestCP - a flag indicating if the entry metainf
- * manifest classpath should be included.
- * @param context - the context to populate
- * @throws IOException on any IO error
- */
- protected void addClassPath(StructureContext structureContext, VirtualFile entry, boolean includeEntry, boolean includeRootManifestCP, ContextInfo context) throws IOException
- {
- boolean trace = log.isTraceEnabled();
-
- List<VirtualFile> paths = new ArrayList<VirtualFile>();
-
- // The path we have been told to add
- if (includeEntry)
- paths.add(entry);
-
- // Add the manifest locations
- if (includeRootManifestCP && isLeaf(entry) == false)
- {
- try
- {
- VFSUtils.addManifestLocations(entry, paths);
- }
- catch(Exception e)
- {
- if (trace)
- log.trace("Failed to add manifest locations", e);
- }
- }
-
- // Translate from VirtualFile to relative paths
- VirtualFile root = structureContext.getRoot();
- for (VirtualFile vf : paths)
- {
- String entryPath = getRelativePath(root, vf);
- ClassPathEntry cpe = StructureMetaDataFactory.createClassPathEntry(entryPath);
- context.addClassPathEntry(cpe);
- if (trace)
- log.trace("Added classpath entry " + entryPath + " for " + vf.getName() + " from " + root);
- }
- }
-
- /**
- * Create annotation environment
- *
- * @param root the deployment root
- * @return new annotation environment
- */
- protected abstract AnnotationEnvironment createAnnotationEnvironment(VirtualFile root);
-
- /**
- * Check for candidate annotations.
- *
- * @param context the structure context
- * @param roots the roots to check
- * @return return true if one of the roots includes some candidate annotation
- */
- protected boolean checkCandidateAnnotations(StructureContext context, VirtualFile... roots)
- {
- if (roots == null || roots.length == 0)
- throw new IllegalArgumentException("Null or empty roots");
-
- if (candidateAnnotations == null || candidateAnnotations.isEmpty())
- return true;
-
- StructureContext parentContext = context.getParentContext();
- if (parentContext == null)
- return true;
-
- Set<CandidateAnnotationsCallback> callbacks = parentContext.getCallbacks(CandidateAnnotationsCallback.class);
- if (callbacks.isEmpty())
- return true;
-
- boolean result = false;
- for(VirtualFile root : roots)
- {
- AnnotationEnvironment env = createAnnotationEnvironment(root);
- for (Class<? extends Annotation> annotationClass : candidateAnnotations)
- {
- if (env.hasClassAnnotatedWith(annotationClass))
- {
- result = true;
- for (CandidateAnnotationsCallback callback : callbacks)
- callback.executeCallback(root, context, env, annotationClass);
- }
- }
- }
- return result;
- }
-
- /**
- * Add all children as candidates
- *
- * @param context the structure context
- * @throws Exception for any error
- */
- protected void addAllChildren(StructureContext context) throws Exception
- {
- addChildren(context, null);
- }
-
- /**
- * Add all children as candidates
- *
- * @param context the structure context
-
- * @param attributes the visitor attributes uses {@link VisitorAttributes#DEFAULT} when null
- * @throws Exception for any error
- */
- protected void addChildren(StructureContext context, VisitorAttributes attributes) throws Exception
- {
- if (context == null)
- throw new IllegalArgumentException("Null context");
-
- VirtualFile file = context.getFile();
- VirtualFileVisitor visitor = candidateStructureVisitorFactory.createVisitor(context, attributes);
- file.visit(visitor);
- }
-
- /**
- * Add all children as candidates
- *
- * @param root the root context
- * @param parent the parent context
- * @param metaData the structure meta data
- * @param deployers the structure deployers
- * @throws Exception for any error
- */
- protected void addAllChildren(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers) throws Exception
- {
- addChildren(root, parent, metaData, deployers, null);
- }
-
- /**
- * Add all children as candidates
- *
- * @param root the root context
- * @param parent the parent context
- * @param metaData the structure meta data
- * @param deployers the structure deployers
- * @param attributes the visitor attributes uses {@link VisitorAttributes#DEFAULT} when null
- * @throws Exception for any error
- */
- protected void addChildren(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers, VisitorAttributes attributes) throws Exception
- {
- if (parent == null)
- throw new IllegalArgumentException("Null parent");
-
- StructureContext context = new StructureContext(root, null, parent, metaData, deployers, null);
- addChildren(context, attributes);
- }
-
- /**
- * Tests whether the virtual file is a leaf
- *
- * @param file the virtual file
- * @return true when it is a leaf
- * @throws IOException for any error
- */
- protected static boolean isLeaf(VirtualFile file) throws IOException
- {
- return SecurityActions.isLeaf(file);
- }
-
- /**
- * Create a context
- *
- * @param context the structure context
- * @return the context info
- * @throws IllegalArgumentException for a null root or structure metaData
- */
- protected ContextInfo createContext(StructureContext context)
- {
- return createContext(context, (String) null);
- }
-
- /**
- * Create a context
- *
- * @param context the structure context
- * @param metaDataPath the metadata path
- * @return the context info
- * @throws IllegalArgumentException for a null root or structure metaData
- */
- protected ContextInfo createContext(StructureContext context, String metaDataPath)
- {
- ContextInfo result = applyMetadataPath(context, metaDataPath);
- applyStructure(context, result);
- return result;
- }
-
- /**
- * Apply metadata on root to create context.
- *
- * @param context the context
- * @param metaDataPath the metadata path
- * @return the context info
- */
- protected ContextInfo applyMetadataPath(StructureContext context, String metaDataPath)
- {
- if (context == null)
- throw new IllegalArgumentException("Null context");
-
- // Determine whether the metadata path exists
- if (metaDataPath != null)
- {
- VirtualFile root = context.getFile();
- try
- {
- VirtualFile child = root.getChild(metaDataPath);
- if (child == null)
- metaDataPath = null;
- }
- catch (IOException e)
- {
- log.warn("Not using metadata path " + metaDataPath + " for " + root.getName() + " reason: " + e.getMessage());
- metaDataPath = null;
- }
- }
-
- // Create and link the context
- if (metaDataPath != null)
- return StructureMetaDataFactory.createContextInfo("", metaDataPath, null);
- else
- return StructureMetaDataFactory.createContextInfo("", null);
- }
-
- /**
- * Create a context
- *
- * @param context the structure context
- * @param metaDataPaths the metadata paths
- * @return the context info
- * @throws IllegalArgumentException for a null root or structure metaData
- */
- protected ContextInfo createContext(StructureContext context, String[] metaDataPaths)
- {
- ContextInfo result = applyMetadataPaths(context, metaDataPaths);
- applyStructure(context, result);
- return result;
- }
-
- /**
- * Apply metadata on root to create context.
- *
- * @param context the structure context
- * @param metaDataPaths the metadata paths
- * @return the context info
- */
- protected ContextInfo applyMetadataPaths(StructureContext context, String[] metaDataPaths)
- {
- if (context == null)
- throw new IllegalArgumentException("Null context");
-
- VirtualFile root = context.getFile();
- List<String> metaDataPath = CollectionsFactory.createLazyList();
- // Determine whether the metadata paths exists
- if (metaDataPaths != null && metaDataPaths.length > 0)
- {
- for(String path : metaDataPaths)
- {
- try
- {
- VirtualFile child = root.getChild(path);
- if (child != null)
- metaDataPath.add(path);
- }
- catch (IOException e)
- {
- log.warn("Not using metadata path " + path + " for " + root.getName() + " reason: " + e.getMessage());
- }
- }
- }
-
- // Create and link the context
- if (metaDataPath.isEmpty())
- return StructureMetaDataFactory.createContextInfo("", null);
- else
- return StructureMetaDataFactory.createContextInfo("", metaDataPath, null);
- }
-
- /**
- * Apply structure metadata on context.
- *
- * @param context the structure context
- * @param contextInfo the new created context
- */
- protected void applyStructure(StructureContext context, ContextInfo contextInfo)
- {
- boolean trace = log.isTraceEnabled();
-
- if (context == null)
- throw new IllegalArgumentException("Null context");
-
- VirtualFile root = context.getRoot();
- applyContextInfo(context, contextInfo);
- context.addChild(contextInfo);
- if (trace)
- log.trace("Added context " + context + " from " + root.getName());
- }
-
- /**
- * Apply context info.
- * Can be overridden for specific root.
- *
- * @param context the structure context
- * @param result the new context info
- */
- protected void applyContextInfo(StructureContext context, ContextInfo result)
- {
- if (result != null && contextInfoOrder != null)
- result.setRelativeOrder(contextInfoOrder);
- }
-}
Copied: projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java (from rev 83487, projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,533 @@
+/*
+* 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.deployers.vfs.spi.structure.helpers;
+
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.deployers.spi.annotations.AnnotationEnvironment;
+import org.jboss.deployers.spi.structure.ClassPathEntry;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.spi.structure.StructureMetaDataFactory;
+import org.jboss.deployers.vfs.spi.structure.CandidateAnnotationsCallback;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
+import org.jboss.deployers.vfs.spi.structure.StructureDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.logging.Logger;
+import org.jboss.util.collection.CollectionsFactory;
+import org.jboss.virtual.VFSUtils;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileVisitor;
+import org.jboss.virtual.VisitorAttributes;
+
+/**
+ * AbstractStructureDeployer.<p>
+ *
+ * We don't care about the order by default.
+ *
+ * @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 $
+ */
+public abstract class AbstractStructureDeployer implements StructureDeployer
+{
+ /** The log */
+ protected Logger log = Logger.getLogger(getClass());
+
+ /** The relative order */
+ private int relativeOrder = Integer.MAX_VALUE;
+
+ /** The candidate structure visitor factory */
+ private CandidateStructureVisitorFactory candidateStructureVisitorFactory = DefaultCandidateStructureVisitorFactory.INSTANCE;
+
+ /** The context info order */
+ private Integer contextInfoOrder;
+
+ /** The supports annotations flag */
+ private boolean supportsCandidateAnnotations;
+
+ /** The candidate annotations */
+ private Set<Class<? extends Annotation>> candidateAnnotations;
+
+ /**
+ * Get the relative path between two virtual files
+ *
+ * @param context the structure context
+ * @param child the child
+ * @return the relative path
+ */
+ public static final String getRelativePath(StructureContext context, VirtualFile child)
+ {
+ if (context == null)
+ throw new IllegalArgumentException("Null context");
+
+ return getRelativePath(context.getParent(), child);
+ }
+
+ /**
+ * Get the relative path between two virtual files
+ *
+ * @param parent the parent
+ * @param child the child
+ * @return the relative path
+ */
+ public static final String getRelativePath(VirtualFile parent, VirtualFile child)
+ {
+ if (child == null)
+ throw new IllegalArgumentException("Null child");
+
+ String childPath = child.getPathName();
+ if (parent != null)
+ {
+ String parentPath = parent.getPathName();
+
+ if (parentPath.length() == childPath.length())
+ return "";
+
+ // Not sure about this? It is obviously not a direct child if it is shorter?
+ if (parentPath.length() < childPath.length())
+ {
+ if (parentPath.endsWith("/") == false)
+ parentPath = parentPath + "/";
+ if (childPath.startsWith(parentPath))
+ return childPath.substring(parentPath.length());
+ }
+ }
+
+ if (childPath.endsWith("/"))
+ childPath = childPath.substring(0, childPath.length()-1);
+
+ return childPath;
+ }
+
+ public int getRelativeOrder()
+ {
+ return relativeOrder;
+ }
+
+ public void setRelativeOrder(int order)
+ {
+ this.relativeOrder = order;
+ }
+
+ public void setContextInfoOrder(Integer contextInfoOrder)
+ {
+ this.contextInfoOrder = contextInfoOrder;
+ }
+
+ /**
+ * Get the candidate annotations.
+ *
+ * @return the candidate annotations
+ */
+ public Set<Class<? extends Annotation>> getCandidateAnnotations()
+ {
+ return candidateAnnotations;
+ }
+
+ /**
+ * Set the candidate annotations.
+ *
+ * @param candidateAnnotations the candidate annotations
+ */
+ public void setCandidateAnnotations(Set<Class<? extends Annotation>> candidateAnnotations)
+ {
+ this.candidateAnnotations = candidateAnnotations;
+ }
+
+ /**
+ * Add candidate annotation.
+ *
+ * @param annotationClass the candidate annotation class
+ */
+ public void addCandidateAnnotation(Class<? extends Annotation> annotationClass)
+ {
+ if (candidateAnnotations == null)
+ candidateAnnotations = new LinkedHashSet<Class<? extends Annotation>>();
+ candidateAnnotations.add(annotationClass);
+ }
+
+ public boolean isSupportsCandidateAnnotations()
+ {
+ return supportsCandidateAnnotations;
+ }
+
+ /**
+ * Set supportsCandidateAnnotations flag.
+ *
+ * @param supportsCandidateAnnotations the support candidate annotations flag
+ */
+ public void setSupportsCandidateAnnotations(boolean supportsCandidateAnnotations)
+ {
+ this.supportsCandidateAnnotations = supportsCandidateAnnotations;
+ }
+
+ /**
+ * Get the candidateStructureVisitorFactory.
+ *
+ * @return the candidateStructureVisitorFactory.
+ */
+ public CandidateStructureVisitorFactory getCandidateStructureVisitorFactory()
+ {
+ return candidateStructureVisitorFactory;
+ }
+
+ /**
+ * Set the candidateStructureVisitorFactory.
+ *
+ * @param candidateStructureVisitorFactory the candidateStructureVisitorFactory.
+ * @throws IllegalArgumentException for a null candidate structure
+ */
+ public void setCandidateStructureVisitorFactory(CandidateStructureVisitorFactory candidateStructureVisitorFactory)
+ {
+ if (candidateStructureVisitorFactory == null)
+ throw new IllegalArgumentException("Null candidateStructureVisitorFactory");
+ this.candidateStructureVisitorFactory = candidateStructureVisitorFactory;
+ }
+
+ /**
+ * Add an entry to the context classpath.
+ *
+ * @param structureContext - the structure context
+ * @param entry - the candidate file to add as a classpath entry
+ * @param includeEntry - a flag indicating if the entry should be added to
+ * the classpath
+ * @param includeRootManifestCP - a flag indicating if the entry metainf
+ * manifest classpath should be included.
+ * @param context - the context to populate
+ * @throws IOException on any IO error
+ */
+ protected void addClassPath(StructureContext structureContext, VirtualFile entry, boolean includeEntry, boolean includeRootManifestCP, ContextInfo context) throws IOException
+ {
+ boolean trace = log.isTraceEnabled();
+
+ List<VirtualFile> paths = new ArrayList<VirtualFile>();
+
+ // The path we have been told to add
+ if (includeEntry)
+ paths.add(entry);
+
+ // Add the manifest locations
+ if (includeRootManifestCP && isLeaf(entry) == false)
+ {
+ try
+ {
+ VFSUtils.addManifestLocations(entry, paths);
+ }
+ catch(Exception e)
+ {
+ if (trace)
+ log.trace("Failed to add manifest locations", e);
+ }
+ }
+
+ // Translate from VirtualFile to relative paths
+ VirtualFile root = structureContext.getRoot();
+ for (VirtualFile vf : paths)
+ {
+ String entryPath = getRelativePath(root, vf);
+ ClassPathEntry cpe = StructureMetaDataFactory.createClassPathEntry(entryPath);
+ context.addClassPathEntry(cpe);
+ if (trace)
+ log.trace("Added classpath entry " + entryPath + " for " + vf.getName() + " from " + root);
+ }
+ }
+
+ /**
+ * Create annotation environment
+ *
+ * @param root the deployment root
+ * @return new annotation environment
+ */
+ protected abstract AnnotationEnvironment createAnnotationEnvironment(VirtualFile root);
+
+ /**
+ * Check for candidate annotations.
+ *
+ * @param context the structure context
+ * @param roots the roots to check
+ * @return return true if one of the roots includes some candidate annotation
+ */
+ protected boolean checkCandidateAnnotations(StructureContext context, VirtualFile... roots)
+ {
+ if (roots == null || roots.length == 0)
+ throw new IllegalArgumentException("Null or empty roots");
+
+ if (candidateAnnotations == null || candidateAnnotations.isEmpty())
+ return true;
+
+ StructureContext parentContext = context.getParentContext();
+ if (parentContext == null)
+ return true;
+
+ Set<CandidateAnnotationsCallback> callbacks = parentContext.getCallbacks(CandidateAnnotationsCallback.class);
+ if (callbacks.isEmpty())
+ return true;
+
+ boolean result = false;
+ for(VirtualFile root : roots)
+ {
+ AnnotationEnvironment env = createAnnotationEnvironment(root);
+ for (Class<? extends Annotation> annotationClass : candidateAnnotations)
+ {
+ if (env.hasClassAnnotatedWith(annotationClass))
+ {
+ result = true;
+ for (CandidateAnnotationsCallback callback : callbacks)
+ callback.executeCallback(root, context, env, annotationClass);
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Add all children as candidates
+ *
+ * @param context the structure context
+ * @throws Exception for any error
+ */
+ protected void addAllChildren(StructureContext context) throws Exception
+ {
+ addChildren(context, null);
+ }
+
+ /**
+ * Add all children as candidates
+ *
+ * @param context the structure context
+
+ * @param attributes the visitor attributes uses {@link VisitorAttributes#DEFAULT} when null
+ * @throws Exception for any error
+ */
+ protected void addChildren(StructureContext context, VisitorAttributes attributes) throws Exception
+ {
+ if (context == null)
+ throw new IllegalArgumentException("Null context");
+
+ VirtualFile file = context.getFile();
+ VirtualFileVisitor visitor = candidateStructureVisitorFactory.createVisitor(context, attributes);
+ file.visit(visitor);
+ }
+
+ /**
+ * Add all children as candidates
+ *
+ * @param root the root context
+ * @param parent the parent context
+ * @param metaData the structure meta data
+ * @param deployers the structure deployers
+ * @throws Exception for any error
+ */
+ protected void addAllChildren(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers) throws Exception
+ {
+ addChildren(root, parent, metaData, deployers, null);
+ }
+
+ /**
+ * Add all children as candidates
+ *
+ * @param root the root context
+ * @param parent the parent context
+ * @param metaData the structure meta data
+ * @param deployers the structure deployers
+ * @param attributes the visitor attributes uses {@link VisitorAttributes#DEFAULT} when null
+ * @throws Exception for any error
+ */
+ protected void addChildren(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers, VisitorAttributes attributes) throws Exception
+ {
+ if (parent == null)
+ throw new IllegalArgumentException("Null parent");
+
+ StructureContext context = new StructureContext(root, null, parent, metaData, deployers, null);
+ addChildren(context, attributes);
+ }
+
+ /**
+ * Tests whether the virtual file is a leaf
+ *
+ * @param file the virtual file
+ * @return true when it is a leaf
+ * @throws IOException for any error
+ */
+ protected static boolean isLeaf(VirtualFile file) throws IOException
+ {
+ return SecurityActions.isLeaf(file);
+ }
+
+ /**
+ * Create a context
+ *
+ * @param context the structure context
+ * @return the context info
+ * @throws IllegalArgumentException for a null root or structure metaData
+ */
+ protected ContextInfo createContext(StructureContext context)
+ {
+ return createContext(context, (String) null);
+ }
+
+ /**
+ * Create a context
+ *
+ * @param context the structure context
+ * @param metaDataPath the metadata path
+ * @return the context info
+ * @throws IllegalArgumentException for a null root or structure metaData
+ */
+ protected ContextInfo createContext(StructureContext context, String metaDataPath)
+ {
+ ContextInfo result = applyMetadataPath(context, metaDataPath);
+ applyStructure(context, result);
+ return result;
+ }
+
+ /**
+ * Apply metadata on root to create context.
+ *
+ * @param context the context
+ * @param metaDataPath the metadata path
+ * @return the context info
+ */
+ protected ContextInfo applyMetadataPath(StructureContext context, String metaDataPath)
+ {
+ if (context == null)
+ throw new IllegalArgumentException("Null context");
+
+ // Determine whether the metadata path exists
+ if (metaDataPath != null)
+ {
+ VirtualFile root = context.getFile();
+ try
+ {
+ VirtualFile child = root.getChild(metaDataPath);
+ if (child == null)
+ metaDataPath = null;
+ }
+ catch (IOException e)
+ {
+ log.warn("Not using metadata path " + metaDataPath + " for " + root.getName() + " reason: " + e.getMessage());
+ metaDataPath = null;
+ }
+ }
+
+ // Create and link the context
+ if (metaDataPath != null)
+ return StructureMetaDataFactory.createContextInfo("", metaDataPath, null);
+ else
+ return StructureMetaDataFactory.createContextInfo("", null);
+ }
+
+ /**
+ * Create a context
+ *
+ * @param context the structure context
+ * @param metaDataPaths the metadata paths
+ * @return the context info
+ * @throws IllegalArgumentException for a null root or structure metaData
+ */
+ protected ContextInfo createContext(StructureContext context, String[] metaDataPaths)
+ {
+ ContextInfo result = applyMetadataPaths(context, metaDataPaths);
+ applyStructure(context, result);
+ return result;
+ }
+
+ /**
+ * Apply metadata on root to create context.
+ *
+ * @param context the structure context
+ * @param metaDataPaths the metadata paths
+ * @return the context info
+ */
+ protected ContextInfo applyMetadataPaths(StructureContext context, String[] metaDataPaths)
+ {
+ if (context == null)
+ throw new IllegalArgumentException("Null context");
+
+ VirtualFile root = context.getFile();
+ List<String> metaDataPath = CollectionsFactory.createLazyList();
+ // Determine whether the metadata paths exists
+ if (metaDataPaths != null && metaDataPaths.length > 0)
+ {
+ for(String path : metaDataPaths)
+ {
+ try
+ {
+ VirtualFile child = root.getChild(path);
+ if (child != null)
+ metaDataPath.add(path);
+ }
+ catch (IOException e)
+ {
+ log.warn("Not using metadata path " + path + " for " + root.getName() + " reason: " + e.getMessage());
+ }
+ }
+ }
+
+ // Create and link the context
+ if (metaDataPath.isEmpty())
+ return StructureMetaDataFactory.createContextInfo("", null);
+ else
+ return StructureMetaDataFactory.createContextInfo("", metaDataPath, null);
+ }
+
+ /**
+ * Apply structure metadata on context.
+ *
+ * @param context the structure context
+ * @param contextInfo the new created context
+ */
+ protected void applyStructure(StructureContext context, ContextInfo contextInfo)
+ {
+ boolean trace = log.isTraceEnabled();
+
+ if (context == null)
+ throw new IllegalArgumentException("Null context");
+
+ VirtualFile root = context.getRoot();
+ applyContextInfo(context, contextInfo);
+ context.addChild(contextInfo);
+ if (trace)
+ log.trace("Added context " + context + " from " + root.getName());
+ }
+
+ /**
+ * Apply context info.
+ * Can be overridden for specific root.
+ *
+ * @param context the structure context
+ * @param result the new context info
+ */
+ protected void applyContextInfo(StructureContext context, ContextInfo result)
+ {
+ if (result != null && contextInfoOrder != null)
+ {
+ result.setRelativeOrder(contextInfoOrder);
+ }
+ }
+}
Deleted: projects/jboss-deployers/tags/2.0.4.GA/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/pom.xml 2009-01-27 11:08:28 UTC (rev 83462)
+++ projects/jboss-deployers/tags/2.0.4.GA/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -1,419 +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.deployers</groupId>
- <artifactId>jboss-deployers</artifactId>
- <version>2.0.4-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>JBoss Deployers Parent POM</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>
- The JBoss Deployment Framework
- </description>
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-deployers/branches/Branch_2_0/</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-deployers/branches/Branch_2_0/</developerConnection>
- <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-deployers/branches/Branch_2_0/</url>
- </scm>
-
- <properties>
- <version.jboss.man>2.0.0.GA</version.jboss.man>
- <version.jboss.mdr>2.0.1.GA</version.jboss.mdr>
- <version.jboss.microcontainer>2.0.2.GA</version.jboss.microcontainer>
- <version.jboss.classloader>2.0.1.GA</version.jboss.classloader>
- <version.jboss.classloading.spi>5.0.0.CR2</version.jboss.classloading.spi>
- <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.aop>2.0.0.SP1</version.jboss.aop>
- <version.jboss.vfs>2.0.0.GA</version.jboss.vfs>
- <version.org.jboss.test>1.1.1.GA</version.org.jboss.test>
- <version.junit>4.4</version.junit>
- <version.javassist>3.9.0.GA</version.javassist>
- <version.stax.staxapi>1.0</version.stax.staxapi>
- </properties>
-
- <modules>
- <module>deployers-core-spi</module>
- <module>deployers-core</module>
- <module>deployers-client-spi</module>
- <module>deployers-client</module>
- <module>deployers-structure-spi</module>
- <module>deployers-spi</module>
- <module>deployers-impl</module>
- <module>deployers-vfs-spi</module>
- <module>deployers-vfs</module>
- <module>build</module>
- </modules>
-
- <build>
- <outputDirectory>${microcontainer.outputDirectory}</outputDirectory>
- <testOutputDirectory>${microcontainer.testOutputDirectory}</testOutputDirectory>
- <finalName>${artifactId}</finalName>
- <plugins>
- <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>
- <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/jboss-deployers/tags</tagBase>
- <autoVersionSubmodules>true</autoVersionSubmodules>
- </configuration>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-idea-plugin</artifactId>
- <configuration>
- <downloadSources>true</downloadSources>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.2</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>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-project-info-reports-plugin</artifactId>
- <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>
- <dependencyManagement>
- <!-- The parent pom manages the inter-dependencies of the modules. -->
- <dependencies>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-structure-spi</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-structure-spi</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-spi</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-impl</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-impl</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- <version>${version.jboss.microcontainer}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- <version>${version.jboss.microcontainer}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.cl</groupId>
- <artifactId>jboss-classloader</artifactId>
- <version>${version.jboss.classloader}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.cl</groupId>
- <artifactId>jboss-classloading</artifactId>
- <version>${version.jboss.classloader}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.cl</groupId>
- <artifactId>jboss-classloading-vfs</artifactId>
- <version>${version.jboss.classloader}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.integration</groupId>
- <artifactId>jboss-classloading-spi</artifactId>
- <version>${version.jboss.classloading.spi}</version>
- </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</groupId>
- <artifactId>jboss-mdr</artifactId>
- <version>${version.jboss.mdr}</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-vfs</artifactId>
- <version>${version.jboss.vfs}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.aop</groupId>
- <artifactId>jboss-aop</artifactId>
- <version>${version.jboss.aop}</version>
- </dependency>
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>${version.javassist}</version>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- <version>${version.stax.staxapi}</version>
- <optional>true</optional>
- </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>
- </dependencies>
- </dependencyManagement>
-
- <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/test-classes</microcontainer.testOutputDirectory>
- </properties>
- </profile>
- <profile>
- <id>assembly</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <inherited>false</inherited>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>install</phase>
- <goals>
- <goal>assembly</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <finalName>jboss-microcontainer-${project.version}</finalName>
- <descriptors>
- <descriptor>build/assembly/dist.xml</descriptor>
- <descriptor>build/assembly/src.xml</descriptor>
- </descriptors>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
Copied: projects/jboss-deployers/tags/2.0.4.GA/pom.xml (from rev 83489, projects/jboss-deployers/branches/Branch_2_0/pom.xml)
===================================================================
--- projects/jboss-deployers/tags/2.0.4.GA/pom.xml (rev 0)
+++ projects/jboss-deployers/tags/2.0.4.GA/pom.xml 2009-01-27 13:42:58 UTC (rev 83490)
@@ -0,0 +1,419 @@
+<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.deployers</groupId>
+ <artifactId>jboss-deployers</artifactId>
+ <version>2.0.4.GA</version>
+ <packaging>pom</packaging>
+ <name>JBoss Deployers Parent POM</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>
+ The JBoss Deployment Framework
+ </description>
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-deployers/tags/2.0.4.GA</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-deployers/tags/2.0.4.GA</developerConnection>
+ <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-deployers/tags/2.0.4.GA</url>
+ </scm>
+
+ <properties>
+ <version.jboss.vfs>2.0.1.GA</version.jboss.vfs>
+ <version.jboss.man>2.0.0.GA</version.jboss.man>
+ <version.jboss.mdr>2.0.1.GA</version.jboss.mdr>
+ <version.jboss.microcontainer>2.0.3.GA</version.jboss.microcontainer>
+ <version.jboss.classloader>2.0.2.GA</version.jboss.classloader>
+ <version.jboss.classloading.spi>5.0.3.GA</version.jboss.classloading.spi>
+ <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.aop>2.0.0.SP1</version.jboss.aop>
+ <version.org.jboss.test>1.1.1.GA</version.org.jboss.test>
+ <version.junit>4.4</version.junit>
+ <version.javassist>3.9.0.GA</version.javassist>
+ <version.stax.staxapi>1.0</version.stax.staxapi>
+ </properties>
+
+ <modules>
+ <module>deployers-core-spi</module>
+ <module>deployers-core</module>
+ <module>deployers-client-spi</module>
+ <module>deployers-client</module>
+ <module>deployers-structure-spi</module>
+ <module>deployers-spi</module>
+ <module>deployers-impl</module>
+ <module>deployers-vfs-spi</module>
+ <module>deployers-vfs</module>
+ <module>build</module>
+ </modules>
+
+ <build>
+ <outputDirectory>${microcontainer.outputDirectory}</outputDirectory>
+ <testOutputDirectory>${microcontainer.testOutputDirectory}</testOutputDirectory>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <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>
+ <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/jboss-deployers/tags</tagBase>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-idea-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.2</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>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <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>
+ <dependencyManagement>
+ <!-- The parent pom manages the inter-dependencies of the modules. -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-structure-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-structure-spi</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-impl</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ <version>${version.jboss.microcontainer}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <version>${version.jboss.microcontainer}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cl</groupId>
+ <artifactId>jboss-classloader</artifactId>
+ <version>${version.jboss.classloader}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cl</groupId>
+ <artifactId>jboss-classloading</artifactId>
+ <version>${version.jboss.classloader}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cl</groupId>
+ <artifactId>jboss-classloading-vfs</artifactId>
+ <version>${version.jboss.classloader}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-classloading-spi</artifactId>
+ <version>${version.jboss.classloading.spi}</version>
+ </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</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ <version>${version.jboss.mdr}</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-vfs</artifactId>
+ <version>${version.jboss.vfs}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop</artifactId>
+ <version>${version.jboss.aop}</version>
+ </dependency>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>${version.javassist}</version>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>${version.stax.staxapi}</version>
+ <optional>true</optional>
+ </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>
+ </dependencies>
+ </dependencyManagement>
+
+ <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/test-classes</microcontainer.testOutputDirectory>
+ </properties>
+ </profile>
+ <profile>
+ <id>assembly</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>install</phase>
+ <goals>
+ <goal>assembly</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <finalName>jboss-microcontainer-${project.version}</finalName>
+ <descriptors>
+ <descriptor>build/assembly/dist.xml</descriptor>
+ <descriptor>build/assembly/src.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
More information about the jboss-cvs-commits
mailing list