[jboss-cvs] JBossAS SVN: r85965 - in projects/mc-int/trunk: build and 15 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Mar 17 06:55:06 EDT 2009
Author: alesj
Date: 2009-03-17 06:55:06 -0400 (Tue, 17 Mar 2009)
New Revision: 85965
Added:
projects/mc-int/trunk/build/
projects/mc-int/trunk/build/JBossORG-EULA.txt
projects/mc-int/trunk/build/pom.xml
projects/mc-int/trunk/build/src/
projects/mc-int/trunk/build/src/assembly/
projects/mc-int/trunk/build/src/assembly/dist-with-deps.xml
projects/mc-int/trunk/build/src/assembly/dist.xml
projects/mc-int/trunk/build/src/assembly/src.xml
projects/mc-int/trunk/pom.xml
projects/mc-int/trunk/servlet/
projects/mc-int/trunk/servlet/pom.xml
projects/mc-int/trunk/servlet/src/
projects/mc-int/trunk/servlet/src/main/
projects/mc-int/trunk/servlet/src/main/java/
projects/mc-int/trunk/servlet/src/main/java/org/
projects/mc-int/trunk/servlet/src/main/java/org/jboss/
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanFactoryInitializerVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanFactoryVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanTypeVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AttachmentVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/BaseAttachmentVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/BaseVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/KernelControllerVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/KernelUtilityVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/KernelVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/NamedAttachmentVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/SimpleBeanVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/VFSDeploymentUnitVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/plugins/
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/plugins/AnnotationEnvironmentVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/plugins/FederatedAnnotationEnvironmentVDFConnector.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/spi/
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/spi/DeploymentUnitAware.java
projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/spi/VDFConnector.java
projects/mc-int/trunk/servlet/src/test/
projects/mc-int/trunk/servlet/src/test/java/
projects/mc-int/trunk/servlet/src/test/resources/
Log:
Move MC VDF + Servlet integration.
Added: projects/mc-int/trunk/build/JBossORG-EULA.txt
===================================================================
--- projects/mc-int/trunk/build/JBossORG-EULA.txt (rev 0)
+++ projects/mc-int/trunk/build/JBossORG-EULA.txt 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,107 @@
+LICENSE AGREEMENT
+JBOSS(r)
+
+This License Agreement governs the use of the Software Packages and any updates to the Software
+Packages, regardless of the delivery mechanism. Each Software Package is a collective work
+under U.S. Copyright Law. Subject to the following terms, Red Hat, Inc. ("Red Hat") grants to
+the user ("Client") a license to the applicable collective work(s) pursuant to the
+GNU Lesser General Public License v. 2.1 except for the following Software Packages:
+(a) JBoss Portal Forums and JBoss Transactions JTS, each of which is licensed pursuant to the
+GNU General Public License v.2;
+
+(b) JBoss Rules, which is licensed pursuant to the Apache License v.2.0;
+
+(c) an optional download for JBoss Cache for the Berkeley DB for Java database, which is licensed under the
+(open source) Sleepycat License (if Client does not wish to use the open source version of this database,
+it may purchase a license from Sleepycat Software);
+
+and (d) the BPEL extension for JBoss jBPM, which is licensed under the Common Public License v.1,
+and, pursuant to the OASIS BPEL4WS standard, requires parties wishing to redistribute to enter various
+royalty-free patent licenses.
+
+Each of the foregoing licenses is available at http://www.opensource.org/licenses/index.php.
+
+1. The Software. "Software Packages" refer to the various software modules that are created and made available
+for distribution by the JBoss.org open source community at http://www.jboss.org. Each of the Software Packages
+may be comprised of hundreds of software components. The end user license agreement for each component is located in
+the component's source code. With the exception of certain image files identified in Section 2 below,
+the license terms for the components permit Client to copy, modify, and redistribute the component,
+in both source code and binary code forms. This agreement does not limit Client's rights under,
+or grant Client rights that supersede, the license terms of any particular component.
+
+2. Intellectual Property Rights. The Software Packages are owned by Red Hat and others and are protected under copyright
+and other laws. Title to the Software Packages and any component, or to any copy, modification, or merged portion shall
+remain with the aforementioned, subject to the applicable license. The "JBoss" trademark, "Red Hat" trademark, the
+individual Software Package trademarks, and the "Shadowman" logo are registered trademarks of Red Hat and its affiliates
+in the U.S. and other countries. This agreement permits Client to distribute unmodified copies of the Software Packages
+using the Red Hat trademarks that Red Hat has inserted in the Software Packages on the condition that Client follows Red Hat's
+trademark guidelines for those trademarks located at http://www.redhat.com/about/corporate/trademark/. Client must abide by
+these trademark guidelines when distributing the Software Packages, regardless of whether the Software Packages have been modified.
+If Client modifies the Software Packages, then Client must replace all Red Hat trademarks and logos identified at
+http://www.jboss.com/company/logos, unless a separate agreement with Red Hat is executed or other permission granted.
+Merely deleting the files containing the Red Hat trademarks may corrupt the Software Packages.
+
+3. Limited Warranty. Except as specifically stated in this Paragraph 3 or a license for a particular
+component, to the maximum extent permitted under applicable law, the Software Packages and the
+components are provided and licensed "as is" without warranty of any kind, expressed or implied,
+including the implied warranties of merchantability, non-infringement or fitness for a particular purpose.
+Red Hat warrants that the media on which Software Packages may be furnished will be free from defects in
+materials and manufacture under normal use for a period of 30 days from the date of delivery to Client.
+Red Hat does not warrant that the functions contained in the Software Packages will meet Client's requirements
+or that the operation of the Software Packages will be entirely error free or appear precisely as described
+in the accompanying documentation. This warranty extends only to the party that purchases the Services
+pertaining to the Software Packages from Red Hat or a Red Hat authorized distributor.
+
+4. Limitation of Remedies and Liability. To the maximum extent permitted by applicable law, the remedies
+described below are accepted by Client as its only remedies. Red Hat's entire liability, and Client's
+exclusive remedies, shall be: If the Software media is defective, Client may return it within 30 days of
+delivery along with a copy of Client's payment receipt and Red Hat, at its option, will replace it or
+refund the money paid by Client for the Software. To the maximum extent permitted by applicable law,
+Red Hat or any Red Hat authorized dealer will not be liable to Client for any incidental or consequential
+damages, including lost profits or lost savings arising out of the use or inability to use the Software,
+even if Red Hat or such dealer has been advised of the possibility of such damages. In no event shall
+Red Hat's liability under this agreement exceed the amount that Client paid to Red Hat under this
+Agreement during the twelve months preceding the action.
+
+5. Export Control. As required by U.S. law, Client represents and warrants that it:
+(a) understands that the Software Packages are subject to export controls under the
+U.S. Commerce Department's Export Administration Regulations ("EAR");
+
+(b) is not located in a prohibited destination country under the EAR or U.S. sanctions regulations
+(currently Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria);
+
+(c) will not export, re-export, or transfer the Software Packages to any prohibited destination, entity,
+or individual without the necessary export license(s) or authorizations(s) from the U.S. Government;
+
+(d) will not use or transfer the Software Packages for use in any sensitive nuclear, chemical or
+biological weapons, or missile technology end-uses unless authorized by the U.S. Government by
+regulation or specific license;
+
+(e) understands and agrees that if it is in the United States and exports or transfers the Software
+Packages to eligible end users, it will, as required by EAR Section 740.17(e), submit semi-annual
+reports to the Commerce Department's Bureau of Industry & Security (BIS), which include the name and
+address (including country) of each transferee;
+
+and (f) understands that countries other than the United States may restrict the import, use, or
+export of encryption products and that it shall be solely responsible for compliance with any such
+import, use, or export restrictions.
+
+6. Third Party Programs. Red Hat may distribute third party software programs with the Software Packages
+that are not part of the Software Packages and which Client must install separately. These third party
+programs are subject to their own license terms. The license terms either accompany the programs or
+can be viewed at http://www.redhat.com/licenses/. If Client does not agree to abide by the applicable
+license terms for such programs, then Client may not install them. If Client wishes to install the programs
+on more than one system or transfer the programs to another party, then Client must contact the licensor
+of the programs.
+
+7. General. If any provision of this agreement is held to be unenforceable, that shall not affect the
+enforceability of the remaining provisions. This License Agreement shall be governed by the laws of the
+State of North Carolina and of the United States, without regard to any conflict of laws provisions,
+except that the United Nations Convention on the International Sale of Goods shall not apply.
+
+Copyright 2006 Red Hat, Inc. All rights reserved.
+"JBoss" and the JBoss logo are registered trademarks of Red Hat, Inc.
+All other trademarks are the property of their respective owners.
+
+ Page 1 of 1 18 October 2006
+
Added: projects/mc-int/trunk/build/pom.xml
===================================================================
--- projects/mc-int/trunk/build/pom.xml (rev 0)
+++ projects/mc-int/trunk/build/pom.xml 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,49 @@
+<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.mc-int</groupId>
+ <artifactId>jboss-mc-int-parent</artifactId>
+ <version>2.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.mc-int</groupId>
+ <artifactId>jboss-mc-int</artifactId>
+ <packaging>pom</packaging>
+ <name>JBoss MC Integration Distribution</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss MC Integration Distribution</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-mc-int-${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.mc-int</groupId>
+ <artifactId>jboss-mc-int-servlet</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: projects/mc-int/trunk/build/src/assembly/dist-with-deps.xml
===================================================================
--- projects/mc-int/trunk/build/src/assembly/dist-with-deps.xml (rev 0)
+++ projects/mc-int/trunk/build/src/assembly/dist-with-deps.xml 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,11 @@
+<assembly>
+ <id>with-deps</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/</outputDirectory>
+ </dependencySet>
+ </dependencySets>
+</assembly>
Added: projects/mc-int/trunk/build/src/assembly/dist.xml
===================================================================
--- projects/mc-int/trunk/build/src/assembly/dist.xml (rev 0)
+++ projects/mc-int/trunk/build/src/assembly/dist.xml 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,11 @@
+<assembly>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/</outputDirectory>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ </dependencySet>
+ </dependencySets>
+</assembly>
Added: projects/mc-int/trunk/build/src/assembly/src.xml
===================================================================
--- projects/mc-int/trunk/build/src/assembly/src.xml (rev 0)
+++ projects/mc-int/trunk/build/src/assembly/src.xml 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,15 @@
+<assembly>
+ <id>src</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <fileSets>
+ <fileSet>
+ <directory>..</directory>
+ <outputDirectory></outputDirectory>
+ <excludes>
+ <exclude>*/target/</exclude>
+ </excludes>
+ </fileSet>
+ </fileSets>
+</assembly>
Added: projects/mc-int/trunk/pom.xml
===================================================================
--- projects/mc-int/trunk/pom.xml (rev 0)
+++ projects/mc-int/trunk/pom.xml 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,427 @@
+<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.mc-int</groupId>
+ <artifactId>jboss-mc-int-parent</artifactId>
+ <version>2.2.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>JBoss MC Integration Parent POM</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss MC integration</description>
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/mc-int/trunk/</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/mc-int/trunk/</developerConnection>
+ <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/mc-int/trunk/</url>
+ </scm>
+
+ <modules>
+ <module>servlet</module>
+ <module>build</module>
+ </modules>
+
+ <properties>
+ <version.jboss.jbossas>5.0.1.GA</version.jboss.jbossas>
+ <version.jboss.vfs>2.1.0.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.4.GA</version.jboss.microcontainer>
+ <version.jboss.deployers>2.0.5.GA</version.jboss.deployers>
+ <version.jboss.classloader>2.0.4.GA</version.jboss.classloader>
+ <version.jboss.common.core>2.2.11.GA</version.jboss.common.core>
+ <version.jboss.common.logging.spi>2.0.5.GA</version.jboss.common.logging.spi>
+ <version.jboss.common.logging.log4j>2.0.5.GA</version.jboss.common.logging.log4j>
+ <version.jbossxb>2.0.0.GA</version.jbossxb>
+ <version.jboss.aop>2.0.1.GA</version.jboss.aop>
+ <version.org.jboss.test>1.0.5.GA</version.org.jboss.test>
+ <version.junit>4.4</version.junit>
+ <version.javassist>3.9.0.GA</version.javassist>
+ <version.xerces>2.9.1</version.xerces>
+ <version.servlet.api>2.5</version.servlet.api>
+ <version.spring>2.5.6</version.spring>
+ </properties>
+
+ <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.1</version>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <includes>
+ <include>org/jboss/test/**/*TestCase.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <layout>default</layout>
+ <url>http://snapshots.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+ <dependencyManagement>
+ <!-- The parent pom manages the inter-dependencies of the modules. -->
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.mc-int</groupId>
+ <artifactId>jboss-mc-int-servlet</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.microcontainer</groupId>
+ <artifactId>jboss-aop-mc-int</artifactId>
+ <version>${version.jboss.microcontainer}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-spring-int</artifactId>
+ <version>${version.jboss.microcontainer}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-guice-int</artifactId>
+ <version>${version.jboss.microcontainer}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client</artifactId>
+ <version>${version.jboss.deployers}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ <version>${version.jboss.deployers}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ <version>${version.jboss.deployers}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-impl</artifactId>
+ <version>${version.jboss.deployers}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>javassist</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-spi</artifactId>
+ <version>${version.jboss.deployers}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-structure-spi</artifactId>
+ <version>${version.jboss.deployers}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ <version>${version.jboss.deployers}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ <version>${version.jboss.deployers}</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.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.common.logging.spi}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <version>${version.jboss.common.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>org.jboss.aop</groupId>
+ <artifactId>jboss-aop-asintegration-core</artifactId>
+ <version>${version.jboss.aop}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-system-jmx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-aspects</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop-asintegration-jmx</artifactId>
+ <version>${version.jboss.aop}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-system-jmx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-j2se</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-jmx</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-aspects</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop-asintegration-mc</artifactId>
+ <version>${version.jboss.aop}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-aspects</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-system-jmx</artifactId>
+ <version>${version.jboss.jbossas}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-aspects</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.aop</groupId>
+ <artifactId>jboss-aop-jdk50</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>javassist</artifactId>
+ <version>${version.javassist}</version>
+ </dependency>
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>${version.xerces}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${version.servlet.api}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${version.spring}</version>
+ </dependency>
+ <dependency>
+ <groupId>aopalliance</groupId>
+ <artifactId>aopalliance</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.jboss</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>
+ </profiles>
+
+</project>
Added: projects/mc-int/trunk/servlet/pom.xml
===================================================================
--- projects/mc-int/trunk/servlet/pom.xml (rev 0)
+++ projects/mc-int/trunk/servlet/pom.xml 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,77 @@
+<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.mc-int</groupId>
+ <artifactId>jboss-mc-int-parent</artifactId>
+ <version>2.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.mc-int</groupId>
+ <artifactId>jboss-mc-int-servlet</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss MC Integration - Servlet</name>
+ <url>http://www.jboss.org/jbossmc</url>
+ <description>JBoss MC Integration - Servlet</description>
+
+ <dependencies>
+ <!-- Compile (global dependencies) -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xml-apis</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</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-core-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanFactoryInitializerVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanFactoryInitializerVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanFactoryInitializerVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,50 @@
+/*
+* 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.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.mc.servlet.vdf.spi.DeploymentUnitAware;
+
+/**
+ * AbstractBeanFactoryInitializerTypeVDFConnector.
+ *
+ * @param <T> exact bean type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractBeanFactoryInitializerVDFConnector<T extends DeploymentUnitAware> extends AbstractBeanFactoryVDFConnector<T>
+{
+ protected AbstractBeanFactoryInitializerVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ @Override
+ protected void initialize(T bean)
+ {
+ VFSDeploymentUnitVDFConnector connector = new VFSDeploymentUnitVDFConnector(getServletContext());
+ if (connector.isValid() == false)
+ throw new IllegalArgumentException("No deployment unit.");
+
+ bean.setDeploymentUnit(connector.getUtility());
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanFactoryVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanFactoryVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanFactoryVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,74 @@
+/*
+* 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.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.beans.metadata.spi.factory.BeanFactory;
+
+/**
+ * AbstractBeanFactoryTypeVDFConnector.
+ *
+ * @param <T> exact bean type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractBeanFactoryVDFConnector<T> extends AbstractBeanVDFConnector<T, BeanFactory>
+{
+ protected AbstractBeanFactoryVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ protected Class<BeanFactory> getBeanType()
+ {
+ return BeanFactory.class;
+ }
+
+ @Override
+ protected T unwrap(BeanFactory factory)
+ {
+ try
+ {
+ Object bean = factory.createBean();
+ Class<T> type = getUnwrappedType();
+ if (type.isInstance(bean) == false)
+ throw new IllegalArgumentException("Bean " + bean + " is not instance of " + type);
+
+ T result = type.cast(bean);
+ initialize(result);
+ return result;
+ }
+ catch (Throwable t)
+ {
+ throw new RuntimeException(t);
+ }
+ }
+
+ /**
+ * Initialize the bean.
+ *
+ * @param bean the bean to initalize
+ */
+ protected void initialize(T bean)
+ {
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanTypeVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanTypeVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanTypeVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+/**
+ * AbstractBeanTypeVDFConnector.
+ *
+ * @param <T> exact bean type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractBeanTypeVDFConnector<T> extends SimpleBeanVDFConnector<T>
+{
+ protected AbstractBeanTypeVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ protected Object getBeanKey()
+ {
+ return getBeanType();
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractBeanVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,136 @@
+/*
+* 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.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants;
+import org.jboss.kernel.spi.dependency.KernelController;
+
+/**
+ * AbstractBeanVDFConnector.
+ *
+ * @param <U> exact unwrapped type
+ * @param <T> exact bean type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractBeanVDFConnector<U, T> extends AbstractVDFConnector<U, Kernel>
+{
+ /** The bean state */
+ private ControllerState state;
+
+ public AbstractBeanVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ protected Class<Kernel> getAttributeType()
+ {
+ return Kernel.class;
+ }
+
+ protected String getAttributeKey()
+ {
+ return KernelConstants.KERNEL_NAME;
+ }
+
+ /**
+ * Get bean key.
+ *
+ * @return the bean key
+ */
+ protected abstract Object getBeanKey();
+
+ /**
+ * The bean type.
+ *
+ * @return the bean type
+ */
+ protected abstract Class<T> getBeanType();
+
+ /**
+ * Get unwrapped type.
+ * e.g. bean might be bean factory
+ *
+ * @return the unwrapped type
+ */
+ protected abstract Class<U> getUnwrappedType();
+
+ /**
+ * Unwrap bean.
+ * Default impl just re-casts.
+ *
+ * @param bean the bean
+ * @return unwrapped bean
+ */
+ protected U unwrap(T bean)
+ {
+ Class<U> unwrappedType = getUnwrappedType();
+ if (unwrappedType.isInstance(bean) == false)
+ throw new IllegalArgumentException("Bean " + bean + " is not instance of " + unwrappedType);
+
+ return unwrappedType.cast(bean);
+ }
+
+ protected U getUtilityFromAttribute(Kernel kernel)
+ {
+ KernelController controller = kernel.getController();
+ ControllerContext context;
+ if (state == null)
+ context = controller.getContext(getBeanKey(), state);
+ else
+ context = controller.getInstalledContext(getBeanKey());
+
+ if (context == null)
+ return null;
+
+ Object target = context.getTarget();
+ Class<T> beanType = getBeanType();
+ if (beanType.isInstance(target) == false)
+ throw new IllegalArgumentException("Bean " + target + " is not instance of " + beanType);
+
+ return unwrap(beanType.cast(target));
+ }
+
+ /**
+ * Set the expected bean state.
+ *
+ * @param state the bean state
+ */
+ public void setState(ControllerState state)
+ {
+ this.state = state;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("bean=").append(getBeanKey());
+ if (state != null)
+ builder.append(", state=").append(state);
+ return builder.toString();
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AbstractVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,106 @@
+/*
+* 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.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.mc.servlet.vdf.spi.VDFConnector;
+
+/**
+ * Abstract VDF connector.
+ *
+ * @param <U> exact vdf utility type
+ * @param <T> exact attribute type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractVDFConnector<U, T> implements VDFConnector<U>
+{
+ private ServletContext servletContext;
+ private U utility;
+
+ protected AbstractVDFConnector(ServletContext servletContext)
+ {
+ if (servletContext == null)
+ throw new IllegalArgumentException("Null servlet context.");
+ this.servletContext = servletContext;
+ }
+
+ /**
+ * Get the servlet context.
+ *
+ * @return the servlet context
+ */
+ protected ServletContext getServletContext()
+ {
+ return servletContext;
+ }
+
+ public void setServletContext(ServletContext context)
+ {
+ this.servletContext = context;
+ }
+
+ /**
+ * Get utility type.
+ *
+ * @return the utility type
+ */
+ protected abstract Class<T> getAttributeType();
+
+ /**
+ * Get utility attribute key.
+ *
+ * @return the attribute key
+ */
+ protected abstract String getAttributeKey();
+
+ public boolean isValid()
+ {
+ return getUtility() != null;
+ }
+
+ public U getUtility()
+ {
+ if (utility == null)
+ {
+ String key = getAttributeKey();
+ Object attribute = servletContext.getAttribute(key);
+ if (attribute != null)
+ {
+ Class<T> type = getAttributeType();
+ if (type.isInstance(attribute) == false)
+ throw new IllegalArgumentException("Attribute " + key + " is not " + type.getName() + " instance: " + attribute);
+
+ utility = getUtilityFromAttribute(type.cast(attribute));
+ }
+ }
+ return utility;
+ }
+
+ /**
+ * Get utility from attribute.
+ *
+ * @param attribute the attribute
+ * @return attribute's utility
+ */
+ protected abstract U getUtilityFromAttribute(T attribute);
+}
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AttachmentVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AttachmentVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/AttachmentVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,51 @@
+/*
+* 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.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * Attachment VDF connector.
+ * It knows how to access vdf attachments from ServletContext.
+ *
+ * @param <U> exact vdf attachment type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AttachmentVDFConnector<U> extends AbstractVDFConnector<U, DeploymentUnit>
+{
+ protected AttachmentVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ protected Class<DeploymentUnit> getAttributeType()
+ {
+ return DeploymentUnit.class;
+ }
+
+ protected String getAttributeKey()
+ {
+ return DeploymentUnit.class.getName();
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/BaseAttachmentVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/BaseAttachmentVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/BaseAttachmentVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,86 @@
+/*
+* 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.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * Attachment VDF connector.
+ * It knows how to access vdf attachments from ServletContext.
+ *
+ * @param <U> exact vdf attachment type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class BaseAttachmentVDFConnector<U> extends AttachmentVDFConnector<U>
+{
+ private boolean allowHierarchyLookup;
+
+ protected BaseAttachmentVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ /**
+ * Get attachment type.
+ *
+ * @return the attachment type
+ */
+ protected abstract Class<U> getAttachmentType();
+
+ protected U getUtilityFromAttribute(DeploymentUnit unit)
+ {
+ U utility = lookup(unit);
+ if (utility == null && allowHierarchyLookup)
+ {
+ DeploymentUnit parent = unit.getParent();
+ while(parent != null && utility == null)
+ {
+ utility = lookup(parent);
+ parent = parent.getParent();
+ }
+ }
+ return utility;
+ }
+
+ /**
+ * Do attachment lookup.
+ *
+ * @param unit the deployment unit
+ * @return the lookup result
+ */
+ protected U lookup(DeploymentUnit unit)
+ {
+ return unit.getAttachment(getAttachmentType());
+ }
+
+ /**
+ * Do we allow to do hierarchy attachment lookup on deployment unit.
+ *
+ * @param allowHierarchyLookup the allow hierarchy lookup flag
+ */
+ public void setAllowHierarchyLookup(boolean allowHierarchyLookup)
+ {
+ this.allowHierarchyLookup = allowHierarchyLookup;
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/BaseVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/BaseVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/BaseVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,44 @@
+/*
+* 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.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+/**
+ * Base VDF connector.
+ * The attribute is the utility.
+ *
+ * @param <U> exact vdf utility type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class BaseVDFConnector<U> extends AbstractVDFConnector<U, U>
+{
+ protected BaseVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ protected U getUtilityFromAttribute(U attribute)
+ {
+ return attribute;
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/KernelControllerVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/KernelControllerVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/KernelControllerVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,45 @@
+/*
+* 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.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+
+/**
+ * KernelVDFConnector.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class KernelControllerVDFConnector extends KernelUtilityVDFConnector<KernelController>
+{
+ public KernelControllerVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ protected KernelController getUtilityFromAttribute(Kernel kernel)
+ {
+ return kernel.getController();
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/KernelUtilityVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/KernelUtilityVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/KernelUtilityVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,51 @@
+/*
+* 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.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants;
+
+/**
+ * KernelUtilityVDFConnector.
+ *
+ * @param <U> exact utility type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class KernelUtilityVDFConnector<U> extends AbstractVDFConnector<U, Kernel>
+{
+ protected KernelUtilityVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ protected Class<Kernel> getAttributeType()
+ {
+ return Kernel.class;
+ }
+
+ protected String getAttributeKey()
+ {
+ return KernelConstants.KERNEL_NAME;
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/KernelVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/KernelVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/KernelVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,50 @@
+/*
+* 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.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants;
+
+/**
+ * KernelVDFConnector.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class KernelVDFConnector extends BaseVDFConnector<Kernel>
+{
+ public KernelVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ protected Class<Kernel> getAttributeType()
+ {
+ return Kernel.class;
+ }
+
+ protected String getAttributeKey()
+ {
+ return KernelConstants.KERNEL_NAME;
+ }
+}
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/NamedAttachmentVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/NamedAttachmentVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/NamedAttachmentVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * Named attachment VDF connector.
+ *
+ * @param <U> exact vdf attachment type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class NamedAttachmentVDFConnector<U> extends BaseAttachmentVDFConnector<U>
+{
+ protected NamedAttachmentVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ /**
+ * Get attachment name.
+ *
+ * @return the attachment name
+ */
+ protected abstract String getAttchmentName();
+
+ protected U lookup(DeploymentUnit unit)
+ {
+ return unit.getAttachment(getAttchmentName(), getAttachmentType());
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/SimpleBeanVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/SimpleBeanVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/SimpleBeanVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+/**
+ * AbstractBeanTypeVDFConnector.
+ *
+ * @param <T> exact bean type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class SimpleBeanVDFConnector<T> extends AbstractBeanVDFConnector<T, T>
+{
+ protected SimpleBeanVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ protected Class<T> getUnwrappedType()
+ {
+ return getBeanType();
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/VFSDeploymentUnitVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/VFSDeploymentUnitVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/api/VFSDeploymentUnitVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,50 @@
+/*
+* 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.mc.servlet.vdf.api;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+
+/**
+ * KernelVDFConnector.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class VFSDeploymentUnitVDFConnector extends BaseVDFConnector<VFSDeploymentUnit>
+{
+ public VFSDeploymentUnitVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ protected Class<VFSDeploymentUnit> getAttributeType()
+ {
+ return VFSDeploymentUnit.class;
+ }
+
+ protected String getAttributeKey()
+ {
+ return DeploymentUnit.class.getName();
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/plugins/AnnotationEnvironmentVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/plugins/AnnotationEnvironmentVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/plugins/AnnotationEnvironmentVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,45 @@
+/*
+* 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.mc.servlet.vdf.plugins;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.deployers.spi.annotations.AnnotationEnvironment;
+import org.jboss.mc.servlet.vdf.api.BaseAttachmentVDFConnector;
+
+/**
+ * AnnotationEnvironment VDF connector.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AnnotationEnvironmentVDFConnector extends BaseAttachmentVDFConnector<AnnotationEnvironment>
+{
+ protected AnnotationEnvironmentVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ protected Class<AnnotationEnvironment> getAttachmentType()
+ {
+ return AnnotationEnvironment.class;
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/plugins/FederatedAnnotationEnvironmentVDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/plugins/FederatedAnnotationEnvironmentVDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/plugins/FederatedAnnotationEnvironmentVDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,84 @@
+/*
+* 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.mc.servlet.vdf.plugins;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.deployers.spi.annotations.AnnotationEnvironment;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.mc.servlet.vdf.api.AttachmentVDFConnector;
+
+/**
+ * AnnotationEnvironment VDF connector.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class FederatedAnnotationEnvironmentVDFConnector extends AttachmentVDFConnector<List<AnnotationEnvironment>>
+{
+ protected FederatedAnnotationEnvironmentVDFConnector(ServletContext servletContext)
+ {
+ super(servletContext);
+ }
+
+ protected List<AnnotationEnvironment> getUtilityFromAttribute(DeploymentUnit unit)
+ {
+ List<AnnotationEnvironment> list = new ArrayList<AnnotationEnvironment>();
+ DeploymentUnit top = unit.getTopLevel();
+ findAllAnnotationEnvironments(top, list);
+ return list;
+ }
+
+ /**
+ * Find all anotation environments recursively.
+ *
+ * @param unit the current deployment unit
+ * @param list the holder list
+ */
+ protected void findAllAnnotationEnvironments(DeploymentUnit unit, List<AnnotationEnvironment> list)
+ {
+ applyAnnotationEnvironment(unit, list);
+ List<DeploymentUnit> children = unit.getChildren();
+ if (children != null && children.isEmpty() == false)
+ {
+ for (DeploymentUnit child : children)
+ {
+ findAllAnnotationEnvironments(child, list);
+ }
+ }
+ }
+
+ /**
+ * Get annotation environment.
+ *
+ * @param unit the deployment unit
+ * @param list the list
+ */
+ protected void applyAnnotationEnvironment(DeploymentUnit unit, List<AnnotationEnvironment> list)
+ {
+ AnnotationEnvironment ae = unit.getAttachment(AnnotationEnvironment.class);
+ if (ae != null)
+ list.add(ae);
+ }
+}
\ No newline at end of file
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/spi/DeploymentUnitAware.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/spi/DeploymentUnitAware.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/spi/DeploymentUnitAware.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,39 @@
+/*
+ * 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.mc.servlet.vdf.spi;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * Deployment unit aware interface.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface DeploymentUnitAware
+{
+ /**
+ * Set deployment unit.
+ *
+ * @param unit the deployment unit
+ */
+ void setDeploymentUnit(DeploymentUnit unit);
+}
Added: projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/spi/VDFConnector.java
===================================================================
--- projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/spi/VDFConnector.java (rev 0)
+++ projects/mc-int/trunk/servlet/src/main/java/org/jboss/mc/servlet/vdf/spi/VDFConnector.java 2009-03-17 10:55:06 UTC (rev 85965)
@@ -0,0 +1,58 @@
+/*
+* 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.mc.servlet.vdf.spi;
+
+import javax.servlet.ServletContext;
+
+/**
+ * VDF connector.
+ * It knows how to access vdf utils from ServletContext.
+ *
+ * @param <U> exact vdf utility type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface VDFConnector<U>
+{
+ /**
+ * Is VDF connector valid.
+ *
+ * Normally this means that servlet context's attribute is present
+ * or some utility from attibute can be derived.
+ *
+ * @return true if utility exists, false otherwise
+ */
+ boolean isValid();
+
+ /**
+ * Get the underlying vdf utility.
+ *
+ * @return the utility
+ */
+ U getUtility();
+
+ /**
+ * Set servlet context.
+ *
+ * @param context the servlet context
+ */
+ void setServletContext(ServletContext context);
+}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list