[jboss-cvs] JBossAS SVN: r95643 - in projects/metadata/common/tags: 2.0.0.Alpha3 and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 27 22:23:41 EDT 2009
Author: remy.maucherat at jboss.com
Date: 2009-10-27 22:23:41 -0400 (Tue, 27 Oct 2009)
New Revision: 95643
Added:
projects/metadata/common/tags/2.0.0.Alpha3/
projects/metadata/common/tags/2.0.0.Alpha3/pom.xml
projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java
projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java
projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/javaee/spec/
projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/javaee/support/
projects/metadata/common/tags/2.0.0.Alpha3/src/main/resources/schema/
Removed:
projects/metadata/common/tags/2.0.0.Alpha3/pom.xml
projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java
projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java
projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/javaee/spec/
projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/javaee/support/
projects/metadata/common/tags/2.0.0.Alpha3/src/main/resources/schema/
Log:
[maven-release-plugin] copy for tag 2.0.0.Alpha3
Copied: projects/metadata/common/tags/2.0.0.Alpha3 (from rev 93711, projects/metadata/common/trunk)
Deleted: projects/metadata/common/tags/2.0.0.Alpha3/pom.xml
===================================================================
--- projects/metadata/common/trunk/pom.xml 2009-09-18 13:08:39 UTC (rev 93711)
+++ projects/metadata/common/tags/2.0.0.Alpha3/pom.xml 2009-10-28 02:23:41 UTC (rev 95643)
@@ -1,221 +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.0.CR1</version>
- </parent>
- <groupId>org.jboss.metadata</groupId>
- <artifactId>jboss-metadata-common</artifactId>
- <packaging>jar</packaging>
- <version>2.0.0-SNAPSHOT</version>
- <name>JBoss Metadata Common</name>
- <url>http://www.jboss.org</url>
- <description>The common JavaEE metadata classes</description>
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/metadata/common/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/metadata/common/trunk</developerConnection>
- </scm>
-
- <build>
- <outputDirectory>${profile.outputDirectory}</outputDirectory>
- <testOutputDirectory>${profile.testOutputDirectory}</testOutputDirectory>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <printSummary>true</printSummary>
- <disableXmlReport>false</disableXmlReport>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
- <testFailureIgnore>false</testFailureIgnore>
- <includes>
- <include>**/*TestCase.java</include>
- </includes>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- <configuration>
- <excludes>
- <exclude>org/jboss/test/metadata/javaee/*TestCase.class</exclude>
- <exclude>org/jboss/test/metadata/javaee/*TestCase$*.class</exclude>
- <exclude>org/jboss/test/metadata/javaee/*.xml</exclude>
- </excludes>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </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 Snapshot Repository</name>
- <layout>default</layout>
- <url>http://snapshots.jboss.org/maven2/</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <!--
- Eclipse settings have been removed from parent. This needs to be
- done via an eclipse profile.
- http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085896#4085896
- -->
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <properties>
- <profile.outputDirectory>target/classes</profile.outputDirectory>
- <profile.testOutputDirectory>target/tests-classes</profile.testOutputDirectory>
- </properties>
- </profile>
-
- <profile>
- <id>eclipse</id>
- <properties>
- <profile.outputDirectory>eclipse-target/classes</profile.outputDirectory>
- <profile.testOutputDirectory>eclipse-target/tests-classes</profile.testOutputDirectory>
- </properties>
- </profile>
- </profiles>
-
- <!-- Compile Dependencies -->
- <dependencies>
-
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <version>2.0.5.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>2.2.14.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-ejb-api</artifactId>
- <version>3.0.0.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>ejb3-persistence</artifactId>
- <version>1.0.2.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-jms-api</artifactId>
- <version>1.1.0.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-spi</artifactId>
- <version>1.0.6.GA</version>
- </dependency>
-
- <dependency>
- <groupId>jboss.jbossws</groupId>
- <artifactId>jboss-jaxws</artifactId>
- <version>3.0.1-native-2.0.4.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- <version>2.0.2.Beta1</version>
- <exclusions>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <version>2.0.0.CR1</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-mdr</artifactId>
- <version>2.0.0.GA</version>
- </dependency>
-
- <dependency>
- <groupId>sun-jaxb</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1.4</version>
- </dependency>
-
- <dependency>
- <groupId>apache-xerces</groupId>
- <artifactId>xml-apis</artifactId>
- <version>2.9.1</version>
- </dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.test</groupId>
- <artifactId>jboss-test</artifactId>
- <version>1.1.4.GA</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
Copied: projects/metadata/common/tags/2.0.0.Alpha3/pom.xml (from rev 95642, projects/metadata/common/trunk/pom.xml)
===================================================================
--- projects/metadata/common/tags/2.0.0.Alpha3/pom.xml (rev 0)
+++ projects/metadata/common/tags/2.0.0.Alpha3/pom.xml 2009-10-28 02:23:41 UTC (rev 95643)
@@ -0,0 +1,221 @@
+<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.0.CR1</version>
+ </parent>
+ <groupId>org.jboss.metadata</groupId>
+ <artifactId>jboss-metadata-common</artifactId>
+ <packaging>jar</packaging>
+ <version>2.0.0.Alpha3</version>
+ <name>JBoss Metadata Common</name>
+ <url>http://www.jboss.org</url>
+ <description>The common JavaEE metadata classes</description>
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/metadata/common/tags/2.0.0.Alpha3</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/metadata/common/tags/2.0.0.Alpha3</developerConnection>
+ </scm>
+
+ <build>
+ <outputDirectory>${profile.outputDirectory}</outputDirectory>
+ <testOutputDirectory>${profile.testOutputDirectory}</testOutputDirectory>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <printSummary>true</printSummary>
+ <disableXmlReport>false</disableXmlReport>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <testFailureIgnore>false</testFailureIgnore>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ <configuration>
+ <excludes>
+ <exclude>org/jboss/test/metadata/javaee/*TestCase.class</exclude>
+ <exclude>org/jboss/test/metadata/javaee/*TestCase$*.class</exclude>
+ <exclude>org/jboss/test/metadata/javaee/*.xml</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </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 Snapshot Repository</name>
+ <layout>default</layout>
+ <url>http://snapshots.jboss.org/maven2/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <!--
+ Eclipse settings have been removed from parent. This needs to be
+ done via an eclipse profile.
+ http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085896#4085896
+ -->
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <profile.outputDirectory>target/classes</profile.outputDirectory>
+ <profile.testOutputDirectory>target/tests-classes</profile.testOutputDirectory>
+ </properties>
+ </profile>
+
+ <profile>
+ <id>eclipse</id>
+ <properties>
+ <profile.outputDirectory>eclipse-target/classes</profile.outputDirectory>
+ <profile.testOutputDirectory>eclipse-target/tests-classes</profile.testOutputDirectory>
+ </properties>
+ </profile>
+ </profiles>
+
+ <!-- Compile Dependencies -->
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <version>2.0.5.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>2.2.14.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-ejb-api</artifactId>
+ <version>3.0.0.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>ejb3-persistence</artifactId>
+ <version>1.0.2.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-jms-api</artifactId>
+ <version>1.1.0.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-spi</artifactId>
+ <version>1.0.6.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss.jbossws</groupId>
+ <artifactId>jboss-jaxws</artifactId>
+ <version>3.0.1-native-2.0.4.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ <version>2.0.2.Beta1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <version>2.0.0.CR1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ <version>2.0.0.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>sun-jaxb</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>2.9.1</version>
+ </dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.test</groupId>
+ <artifactId>jboss-test</artifactId>
+ <version>1.1.4.GA</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Deleted: projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java 2009-09-18 13:08:39 UTC (rev 93711)
+++ projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java 2009-10-28 02:23:41 UTC (rev 95643)
@@ -1,141 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, 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.metadata.annotation.creator;
-
-import java.lang.reflect.AnnotatedElement;
-
-import org.jboss.metadata.annotation.creator.ws.WebServiceRefClassProcessor;
-import org.jboss.metadata.annotation.creator.ws.WebServiceRefFieldProcessor;
-import org.jboss.metadata.annotation.creator.ws.WebServiceRefMethodProcessor;
-import org.jboss.metadata.annotation.creator.ws.WebServiceRefsClassProcessor;
-import org.jboss.metadata.annotation.finder.AnnotationFinder;
-import org.jboss.metadata.javaee.spec.AnnotatedEJBReferencesMetaData;
-import org.jboss.metadata.javaee.spec.EnvironmentRefsGroupMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceContextReferencesMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceUnitReferencesMetaData;
-import org.jboss.metadata.javaee.spec.RemoteEnvironmentRefsGroupMetaData;
-import org.jboss.metadata.javaee.spec.ServiceReferencesMetaData;
-
-/**
- * A base javaee component processor.
- * @param MD - the component metadata type
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision: 77146 $
- */
-public abstract class AbstractComponentProcessor<MD>
- extends AbstractProcessor<MD>
-{
-
- public AbstractComponentProcessor(AnnotationFinder<AnnotatedElement> finder)
- {
- super(finder);
-
- // Add component environment processors
- // @Resources/@Resource
- addMethodProcessor(new ResourceMethodProcessor(finder));
- addFieldProcessor(new ResourceFieldProcessor(finder));
- addTypeProcessor(new ResourceClassProcessor(finder));
- addTypeProcessor(new ResourcesClassProcessor(finder));
- // @EJBs/@EJB
- addMethodProcessor(new EJBMethodProcessor(finder));
- addFieldProcessor(new EJBFieldProcessor(finder));
- addTypeProcessor(new EJBClassProcessor(finder));
- addTypeProcessor(new EJBsClassProcessor(finder));
- // @PersistenceContext
- addFieldProcessor(new PersistenceContextFieldProcessor(finder));
- addMethodProcessor(new PersistenceContextMethodProcessor(finder));
- addTypeProcessor(new PersistenceContextClassProcessor(finder));
- addTypeProcessor(new PersistenceContextsClassProcessor(finder));
- // @PersistenceUnit/@PersistenceUnits
- addFieldProcessor(new PersistenceUnitFieldProcessor(finder));
- addMethodProcessor(new PersistenceUnitMethodProcessor(finder));
- addTypeProcessor(new PersistenceUnitClassProcessor(finder));
- addTypeProcessor(new PersistenceUnitsClassProcessor(finder));
- // @PostConstruct/@PreDestroy
- addMethodProcessor(new PostConstructMethodProcessor(finder));
- addMethodProcessor(new PreDestroyMethodProcessor(finder));
- // @WebServiceRef (includes @HandlerChain)
- addMethodProcessor(new WebServiceRefMethodProcessor(finder));
- addFieldProcessor(new WebServiceRefFieldProcessor(finder));
- addTypeProcessor(new WebServiceRefClassProcessor(finder));
- addTypeProcessor(new WebServiceRefsClassProcessor(finder));
- }
-
- /**
- * Process type for remote environment metadata related annotations
- *
- * @param metaData
- * @param type
- */
- public void process(RemoteEnvironmentRefsGroupMetaData metaData, Class<?> type)
- {
- // @Resources/@Resource
- processClass(metaData, type, RemoteEnvironmentRefsGroupMetaData.class);
-
- // @EJBs/@EJB
- AnnotatedEJBReferencesMetaData aejbRefs = metaData.getAnnotatedEjbReferences();
- if(aejbRefs == null)
- {
- aejbRefs = new AnnotatedEJBReferencesMetaData();
- metaData.setAnnotatedEjbReferences(aejbRefs);
- }
- processClass(aejbRefs, type);
-
- // @PersistenceUnit
- PersistenceUnitReferencesMetaData puRefs = metaData.getPersistenceUnitRefs();
- if(puRefs == null)
- {
- puRefs = new PersistenceUnitReferencesMetaData();
- metaData.setPersistenceUnitRefs(puRefs);
- }
- processClass(puRefs, type);
- // @WebServiceRefs/@WebServiceRef
- ServiceReferencesMetaData wsRefs = metaData.getServiceReferences();
- if(wsRefs == null)
- {
- wsRefs = new ServiceReferencesMetaData();
- metaData.setServiceReferences(wsRefs);
- }
- processClass(wsRefs, type);
- }
-
- /**
- * Process type for environment metadata related annotations
- *
- * @param metaData
- * @param type
- */
- public void process(EnvironmentRefsGroupMetaData metaData, Class<?> type)
- {
- this.process((RemoteEnvironmentRefsGroupMetaData)metaData, type);
-
- // @PersistenceContext
- PersistenceContextReferencesMetaData pcRefs = metaData.getPersistenceContextRefs();
- if(pcRefs == null)
- {
- pcRefs = new PersistenceContextReferencesMetaData();
- metaData.setPersistenceContextRefs(pcRefs);
- }
- processClass(pcRefs, type);
- }
-}
Copied: projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java (from rev 95641, projects/metadata/common/trunk/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java)
===================================================================
--- projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java (rev 0)
+++ projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java 2009-10-28 02:23:41 UTC (rev 95643)
@@ -0,0 +1,142 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.metadata.annotation.creator;
+
+import java.lang.reflect.AnnotatedElement;
+
+import org.jboss.metadata.annotation.creator.ws.WebServiceRefClassProcessor;
+import org.jboss.metadata.annotation.creator.ws.WebServiceRefFieldProcessor;
+import org.jboss.metadata.annotation.creator.ws.WebServiceRefMethodProcessor;
+import org.jboss.metadata.annotation.creator.ws.WebServiceRefsClassProcessor;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.javaee.spec.AnnotatedEJBReferencesMetaData;
+import org.jboss.metadata.javaee.spec.EnvironmentRefsGroupMetaData;
+import org.jboss.metadata.javaee.spec.PersistenceContextReferencesMetaData;
+import org.jboss.metadata.javaee.spec.PersistenceUnitReferencesMetaData;
+import org.jboss.metadata.javaee.spec.RemoteEnvironmentRefsGroupMetaData;
+import org.jboss.metadata.javaee.spec.ServiceReferencesMetaData;
+
+/**
+ * A base javaee component processor.
+ * @param MD - the component metadata type
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 77146 $
+ */
+public abstract class AbstractComponentProcessor<MD>
+ extends AbstractProcessor<MD>
+{
+
+ public AbstractComponentProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+
+ // Add component environment processors
+ // @Resources/@Resource
+ addMethodProcessor(new ResourceMethodProcessor(finder));
+ addFieldProcessor(new ResourceFieldProcessor(finder));
+ addTypeProcessor(new ResourceClassProcessor(finder));
+ addTypeProcessor(new ResourcesClassProcessor(finder));
+ // @EJBs/@EJB
+ addMethodProcessor(new EJBMethodProcessor(finder));
+ addFieldProcessor(new EJBFieldProcessor(finder));
+ addTypeProcessor(new EJBClassProcessor(finder));
+ addTypeProcessor(new EJBsClassProcessor(finder));
+ // @PersistenceContext
+ addFieldProcessor(new PersistenceContextFieldProcessor(finder));
+ addMethodProcessor(new PersistenceContextMethodProcessor(finder));
+ addTypeProcessor(new PersistenceContextClassProcessor(finder));
+ addTypeProcessor(new PersistenceContextsClassProcessor(finder));
+ // @PersistenceUnit/@PersistenceUnits
+ addFieldProcessor(new PersistenceUnitFieldProcessor(finder));
+ addMethodProcessor(new PersistenceUnitMethodProcessor(finder));
+ addTypeProcessor(new PersistenceUnitClassProcessor(finder));
+ addTypeProcessor(new PersistenceUnitsClassProcessor(finder));
+ // @PostConstruct/@PreDestroy
+ addMethodProcessor(new PostConstructMethodProcessor(finder));
+ addMethodProcessor(new PreDestroyMethodProcessor(finder));
+ // @WebServiceRef (includes @HandlerChain)
+ addMethodProcessor(new WebServiceRefMethodProcessor(finder));
+ addFieldProcessor(new WebServiceRefFieldProcessor(finder));
+ addTypeProcessor(new WebServiceRefClassProcessor(finder));
+ addTypeProcessor(new WebServiceRefsClassProcessor(finder));
+ // TODO: @DataSourceDefinitions/@DataSourceDefinition
+ }
+
+ /**
+ * Process type for remote environment metadata related annotations
+ *
+ * @param metaData
+ * @param type
+ */
+ public void process(RemoteEnvironmentRefsGroupMetaData metaData, Class<?> type)
+ {
+ // @Resources/@Resource
+ processClass(metaData, type, RemoteEnvironmentRefsGroupMetaData.class);
+
+ // @EJBs/@EJB
+ AnnotatedEJBReferencesMetaData aejbRefs = metaData.getAnnotatedEjbReferences();
+ if(aejbRefs == null)
+ {
+ aejbRefs = new AnnotatedEJBReferencesMetaData();
+ metaData.setAnnotatedEjbReferences(aejbRefs);
+ }
+ processClass(aejbRefs, type);
+
+ // @PersistenceUnit
+ PersistenceUnitReferencesMetaData puRefs = metaData.getPersistenceUnitRefs();
+ if(puRefs == null)
+ {
+ puRefs = new PersistenceUnitReferencesMetaData();
+ metaData.setPersistenceUnitRefs(puRefs);
+ }
+ processClass(puRefs, type);
+ // @WebServiceRefs/@WebServiceRef
+ ServiceReferencesMetaData wsRefs = metaData.getServiceReferences();
+ if(wsRefs == null)
+ {
+ wsRefs = new ServiceReferencesMetaData();
+ metaData.setServiceReferences(wsRefs);
+ }
+ processClass(wsRefs, type);
+ }
+
+ /**
+ * Process type for environment metadata related annotations
+ *
+ * @param metaData
+ * @param type
+ */
+ public void process(EnvironmentRefsGroupMetaData metaData, Class<?> type)
+ {
+ this.process((RemoteEnvironmentRefsGroupMetaData)metaData, type);
+
+ // @PersistenceContext
+ PersistenceContextReferencesMetaData pcRefs = metaData.getPersistenceContextRefs();
+ if(pcRefs == null)
+ {
+ pcRefs = new PersistenceContextReferencesMetaData();
+ metaData.setPersistenceContextRefs(pcRefs);
+ }
+ processClass(pcRefs, type);
+ }
+}
Deleted: projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java 2009-09-18 13:08:39 UTC (rev 93711)
+++ projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java 2009-10-28 02:23:41 UTC (rev 95643)
@@ -1,259 +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.metadata.ejb.jboss;
-
-import java.io.Serializable;
-
-import javax.xml.bind.annotation.XmlElement;
-
-import org.jboss.metadata.javaee.jboss.JBossServiceReferenceMetaData;
-import org.jboss.metadata.javaee.jboss.JBossServiceReferencesMetaData;
-import org.jboss.metadata.javaee.spec.EJBLocalReferenceMetaData;
-import org.jboss.metadata.javaee.spec.EJBLocalReferencesMetaData;
-import org.jboss.metadata.javaee.spec.Environment;
-import org.jboss.metadata.javaee.spec.EnvironmentRefsGroupMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceContextReferenceMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceContextReferencesMetaData;
-import org.jboss.metadata.javaee.spec.RemoteEnvironmentRefsGroupMetaData;
-import org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
-import org.jboss.metadata.javaee.spec.ResourceReferencesMetaData;
-import org.jboss.metadata.javaee.spec.ServiceReferencesMetaData;
-import org.jboss.xb.annotations.JBossXmlCollection;
-import org.jboss.xb.annotations.JBossXmlModelGroup;
-
-/**
- * JBossEnvironmentRefsGroupMetaData.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
- at JBossXmlModelGroup(name="jndiEnvironmentRefsGroup",
- propOrder={"environmentEntries", "ejbReferences", "ejbLocalReferences",
- "serviceReferences", "resourceReferences", "resourceEnvironmentReferences",
- "messageDestinationReferences", "persistenceContextRefs", "persistenceUnitRefs",
- "postConstructs", "preDestroys"})
-public class JBossEnvironmentRefsGroupMetaData
- extends RemoteEnvironmentRefsGroupMetaData
- implements Serializable, Environment
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = 4642263968653845579L;
-
- /** The ejb local references */
- private EJBLocalReferencesMetaData ejbLocalReferences;
-
- /** The service references */
- private JBossServiceReferencesMetaData serviceReferences;
-
- /** The persistence context reference */
- private PersistenceContextReferencesMetaData persistenceContextRefs;
-
- /**
- * Merge an environment
- *
- * @param jbossEnvironmentRefsGroup the override environment
- * @param environmentRefsGroup the overriden environment
- * @param overridenFile the overriden file name
- * @param overrideFile the override file
- * @return the merged environment
- */
- public static JBossEnvironmentRefsGroupMetaData mergeNew(JBossEnvironmentRefsGroupMetaData jbossEnvironmentRefsGroup,
- EnvironmentRefsGroupMetaData environmentRefsGroup,
- ResourceManagersMetaData resourceMgrs,
- String overrideFile, String overridenFile, boolean mustOverride)
- {
- JBossEnvironmentRefsGroupMetaData merged = new JBossEnvironmentRefsGroupMetaData();
-
- merged.merge(jbossEnvironmentRefsGroup, environmentRefsGroup, resourceMgrs, overridenFile, overrideFile, mustOverride);
-
- return merged;
- }
-
- public EJBLocalReferenceMetaData getEjbLocalReferenceByName(String name)
- {
- EJBLocalReferenceMetaData ref = null;
- if(this.ejbLocalReferences != null)
- ref = ejbLocalReferences.get(name);
- return ref;
- }
-
- public PersistenceContextReferenceMetaData getPersistenceContextReferenceByName(String name)
- {
- PersistenceContextReferenceMetaData ref = null;
- if(this.persistenceContextRefs != null)
- ref = persistenceContextRefs.get(name);
- return ref;
- }
-
- public ServiceReferencesMetaData getServiceReferences()
- {
- return serviceReferences;
- }
-
- @JBossXmlCollection(type=JBossServiceReferencesMetaData.class)
- @XmlElement(name="service-ref", type=JBossServiceReferenceMetaData.class)
- public void setServiceReferences(ServiceReferencesMetaData serviceReferences)
- {
- this.serviceReferences = (JBossServiceReferencesMetaData) serviceReferences;
- }
-
-
- public EJBLocalReferencesMetaData getEjbLocalReferences()
- {
- return ejbLocalReferences;
- }
-
- @XmlElement(name="ejb-local-ref")
- public void setEjbLocalReferences(EJBLocalReferencesMetaData ejbLocalReferences)
- {
- this.ejbLocalReferences = ejbLocalReferences;
- }
-
-
- public PersistenceContextReferencesMetaData getPersistenceContextRefs()
- {
- return persistenceContextRefs;
- }
-
- @XmlElement(name="persistence-context-ref")
- public void setPersistenceContextRefs(PersistenceContextReferencesMetaData persistenceContextRefs)
- {
- this.persistenceContextRefs = persistenceContextRefs;
- }
-
-
- /**
- * Merge an environment
- *
- * @param jbossEnvironmentRefsGroup the override environment
- * @param environmentRefsGroup the overriden environment
- * @param overridenFile the overriden file name
- * @param overrideFile the override file
- * @return the merged environment
- */
- public void merge(JBossEnvironmentRefsGroupMetaData jbossEnv,
- Environment specEnv,
- ResourceManagersMetaData resourceMgrs,
- String overrideFile, String overridenFile, boolean mustOverride)
- {
- if (jbossEnv == null && specEnv == null)
- return;
-
- super.merge(jbossEnv, specEnv, overridenFile, overrideFile, mustOverride);
-
- EJBLocalReferencesMetaData ejbLocalRefs = null;
- EJBLocalReferencesMetaData jbossEjbLocalRefs = null;
- PersistenceContextReferencesMetaData specPersistenceContextRefs = null;
- PersistenceContextReferencesMetaData jbossPersistenceContextRefs = null;
-
- if (specEnv != null)
- {
- ejbLocalRefs = specEnv.getEjbLocalReferences();
- specPersistenceContextRefs = specEnv.getPersistenceContextRefs();
- }
-
- if (jbossEnv != null)
- {
- jbossEjbLocalRefs = jbossEnv.getEjbLocalReferences();
- jbossPersistenceContextRefs = jbossEnv.getPersistenceContextRefs();
- }
- else
- {
- // Use the merge target for the static merge methods
- jbossEjbLocalRefs = this.getEjbLocalReferences();
- jbossPersistenceContextRefs = getPersistenceContextRefs();
- }
-
- EJBLocalReferencesMetaData mergedEjbLocalRefs = EJBLocalReferencesMetaData.merge(jbossEjbLocalRefs, ejbLocalRefs, overridenFile, overrideFile);
- if (mergedEjbLocalRefs != null)
- this.setEjbLocalReferences(mergedEjbLocalRefs);
-
- // Need to set the jndi name from resource mgr if referenced
- ResourceReferencesMetaData jbossResRefs = getResourceReferences();
- if(resourceMgrs != null && jbossResRefs != null)
- {
- for(ResourceReferenceMetaData ref : jbossResRefs)
- {
- ResourceManagerMetaData mgr = resourceMgrs.get(ref.getResourceName());
- if(mgr != null)
- {
- if(mgr.getResJndiName() != null)
- ref.setJndiName(mgr.getResJndiName());
- else if(mgr.getResUrl() != null)
- ref.setResUrl(mgr.getResUrl());
- }
- }
- }
-
- PersistenceContextReferencesMetaData mergedPcRefs = PersistenceContextReferencesMetaData.merge(jbossPersistenceContextRefs,
- specPersistenceContextRefs, overridenFile, overrideFile);
- if (mergedPcRefs != null)
- this.setPersistenceContextRefs(mergedPcRefs);
-
- }
-
- public void merge(JBossEnvironmentRefsGroupMetaData override, JBossEnvironmentRefsGroupMetaData original, ResourceManagersMetaData resourceManagers)
- {
- super.merge(override, original, "deployment descriptors", "annotations", false);
-
- EJBLocalReferencesMetaData originalLocalRefs = null;
- PersistenceContextReferencesMetaData originalPctxRefs = null;
- if(original != null)
- {
- originalLocalRefs = original.ejbLocalReferences;
- originalPctxRefs = original.persistenceContextRefs;
- }
-
- EJBLocalReferencesMetaData overrideLocalRefs = null;
- PersistenceContextReferencesMetaData overridePctxRefs = null;
- if(override != null)
- {
- overrideLocalRefs = override.ejbLocalReferences;
- overridePctxRefs = override.persistenceContextRefs;
- }
-
- EJBLocalReferencesMetaData mergedEjbLocalRefs = EJBLocalReferencesMetaData.merge(overrideLocalRefs, originalLocalRefs, null, "jboss.xml");
- if (mergedEjbLocalRefs != null)
- this.setEjbLocalReferences(mergedEjbLocalRefs);
-
- PersistenceContextReferencesMetaData mergedPctxRefs = PersistenceContextReferencesMetaData.merge(overridePctxRefs, originalPctxRefs, null, "jboss.xml");
- if(mergedPctxRefs != null)
- this.setPersistenceContextRefs(mergedPctxRefs);
-
- // Need to set the jndi name from resource mgr if referenced
- ResourceReferencesMetaData jbossResRefs = getResourceReferences();
- if(resourceManagers != null && jbossResRefs != null)
- {
- for(ResourceReferenceMetaData ref : jbossResRefs)
- {
- ResourceManagerMetaData mgr = resourceManagers.get(ref.getResourceName());
- if(mgr != null)
- {
- if(mgr.getResJndiName() != null)
- ref.setJndiName(mgr.getResJndiName());
- else if(mgr.getResUrl() != null)
- ref.setResUrl(mgr.getResUrl());
- }
- }
- }
- }
-}
Copied: projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java (from rev 95641, projects/metadata/common/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java)
===================================================================
--- projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java (rev 0)
+++ projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java 2009-10-28 02:23:41 UTC (rev 95643)
@@ -0,0 +1,287 @@
+/*
+* 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.metadata.ejb.jboss;
+
+import java.io.Serializable;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.jboss.metadata.javaee.jboss.JBossServiceReferenceMetaData;
+import org.jboss.metadata.javaee.jboss.JBossServiceReferencesMetaData;
+import org.jboss.metadata.javaee.spec.DataSourceMetaData;
+import org.jboss.metadata.javaee.spec.DataSourcesMetaData;
+import org.jboss.metadata.javaee.spec.EJBLocalReferenceMetaData;
+import org.jboss.metadata.javaee.spec.EJBLocalReferencesMetaData;
+import org.jboss.metadata.javaee.spec.Environment;
+import org.jboss.metadata.javaee.spec.EnvironmentRefsGroupMetaData;
+import org.jboss.metadata.javaee.spec.PersistenceContextReferenceMetaData;
+import org.jboss.metadata.javaee.spec.PersistenceContextReferencesMetaData;
+import org.jboss.metadata.javaee.spec.RemoteEnvironmentRefsGroupMetaData;
+import org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
+import org.jboss.metadata.javaee.spec.ResourceReferencesMetaData;
+import org.jboss.metadata.javaee.spec.ServiceReferencesMetaData;
+import org.jboss.metadata.javaee.support.AbstractMappedMetaData;
+import org.jboss.xb.annotations.JBossXmlCollection;
+import org.jboss.xb.annotations.JBossXmlModelGroup;
+
+/**
+ * JBossEnvironmentRefsGroupMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlModelGroup(name="jndiEnvironmentRefsGroup",
+ propOrder={"environmentEntries", "ejbReferences", "ejbLocalReferences",
+ "serviceReferences", "resourceReferences", "resourceEnvironmentReferences",
+ "messageDestinationReferences", "persistenceContextRefs", "persistenceUnitRefs",
+ "postConstructs", "preDestroys"})
+public class JBossEnvironmentRefsGroupMetaData
+ extends RemoteEnvironmentRefsGroupMetaData
+ implements Serializable, Environment
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 4642263968653845579L;
+
+ /** The ejb local references */
+ private EJBLocalReferencesMetaData ejbLocalReferences;
+
+ /** The service references */
+ private JBossServiceReferencesMetaData serviceReferences;
+
+ /** The persistence context reference */
+ private PersistenceContextReferencesMetaData persistenceContextRefs;
+
+ /** The data sources */
+ private DataSourcesMetaData dataSources;
+
+ /**
+ * Merge an environment
+ *
+ * @param jbossEnvironmentRefsGroup the override environment
+ * @param environmentRefsGroup the overriden environment
+ * @param overridenFile the overriden file name
+ * @param overrideFile the override file
+ * @return the merged environment
+ */
+ public static JBossEnvironmentRefsGroupMetaData mergeNew(JBossEnvironmentRefsGroupMetaData jbossEnvironmentRefsGroup,
+ EnvironmentRefsGroupMetaData environmentRefsGroup,
+ ResourceManagersMetaData resourceMgrs,
+ String overrideFile, String overridenFile, boolean mustOverride)
+ {
+ JBossEnvironmentRefsGroupMetaData merged = new JBossEnvironmentRefsGroupMetaData();
+
+ merged.merge(jbossEnvironmentRefsGroup, environmentRefsGroup, resourceMgrs, overridenFile, overrideFile, mustOverride);
+
+ return merged;
+ }
+
+ public EJBLocalReferenceMetaData getEjbLocalReferenceByName(String name)
+ {
+ EJBLocalReferenceMetaData ref = null;
+ if(this.ejbLocalReferences != null)
+ ref = ejbLocalReferences.get(name);
+ return ref;
+ }
+
+ public PersistenceContextReferenceMetaData getPersistenceContextReferenceByName(String name)
+ {
+ PersistenceContextReferenceMetaData ref = null;
+ if(this.persistenceContextRefs != null)
+ ref = persistenceContextRefs.get(name);
+ return ref;
+ }
+
+ public ServiceReferencesMetaData getServiceReferences()
+ {
+ return serviceReferences;
+ }
+
+ @JBossXmlCollection(type=JBossServiceReferencesMetaData.class)
+ @XmlElement(name="service-ref", type=JBossServiceReferenceMetaData.class)
+ public void setServiceReferences(ServiceReferencesMetaData serviceReferences)
+ {
+ this.serviceReferences = (JBossServiceReferencesMetaData) serviceReferences;
+ }
+
+
+ public EJBLocalReferencesMetaData getEjbLocalReferences()
+ {
+ return ejbLocalReferences;
+ }
+
+ @XmlElement(name="ejb-local-ref")
+ public void setEjbLocalReferences(EJBLocalReferencesMetaData ejbLocalReferences)
+ {
+ this.ejbLocalReferences = ejbLocalReferences;
+ }
+
+
+ public PersistenceContextReferencesMetaData getPersistenceContextRefs()
+ {
+ return persistenceContextRefs;
+ }
+
+ @XmlElement(name="persistence-context-ref")
+ public void setPersistenceContextRefs(PersistenceContextReferencesMetaData persistenceContextRefs)
+ {
+ this.persistenceContextRefs = persistenceContextRefs;
+ }
+
+ public DataSourcesMetaData getDataSources()
+ {
+ return dataSources;
+ }
+ @XmlElement(name="data-source")
+ public void setDataSources(DataSourcesMetaData dataSources)
+ {
+ this.dataSources = dataSources;
+ }
+
+ public DataSourceMetaData getDataSourceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, dataSources);
+ }
+
+ /**
+ * Merge an environment
+ *
+ * @param jbossEnvironmentRefsGroup the override environment
+ * @param environmentRefsGroup the overriden environment
+ * @param overridenFile the overriden file name
+ * @param overrideFile the override file
+ * @return the merged environment
+ */
+ public void merge(JBossEnvironmentRefsGroupMetaData jbossEnv,
+ Environment specEnv,
+ ResourceManagersMetaData resourceMgrs,
+ String overrideFile, String overridenFile, boolean mustOverride)
+ {
+ if (jbossEnv == null && specEnv == null)
+ return;
+
+ super.merge(jbossEnv, specEnv, overridenFile, overrideFile, mustOverride);
+
+ EJBLocalReferencesMetaData ejbLocalRefs = null;
+ EJBLocalReferencesMetaData jbossEjbLocalRefs = null;
+ PersistenceContextReferencesMetaData specPersistenceContextRefs = null;
+ PersistenceContextReferencesMetaData jbossPersistenceContextRefs = null;
+
+ if (specEnv != null)
+ {
+ ejbLocalRefs = specEnv.getEjbLocalReferences();
+ specPersistenceContextRefs = specEnv.getPersistenceContextRefs();
+ }
+
+ if (jbossEnv != null)
+ {
+ jbossEjbLocalRefs = jbossEnv.getEjbLocalReferences();
+ jbossPersistenceContextRefs = jbossEnv.getPersistenceContextRefs();
+ }
+ else
+ {
+ // Use the merge target for the static merge methods
+ jbossEjbLocalRefs = this.getEjbLocalReferences();
+ jbossPersistenceContextRefs = getPersistenceContextRefs();
+ }
+
+ EJBLocalReferencesMetaData mergedEjbLocalRefs = EJBLocalReferencesMetaData.merge(jbossEjbLocalRefs, ejbLocalRefs, overridenFile, overrideFile);
+ if (mergedEjbLocalRefs != null)
+ this.setEjbLocalReferences(mergedEjbLocalRefs);
+
+ // Need to set the jndi name from resource mgr if referenced
+ ResourceReferencesMetaData jbossResRefs = getResourceReferences();
+ if(resourceMgrs != null && jbossResRefs != null)
+ {
+ for(ResourceReferenceMetaData ref : jbossResRefs)
+ {
+ ResourceManagerMetaData mgr = resourceMgrs.get(ref.getResourceName());
+ if(mgr != null)
+ {
+ if(mgr.getResJndiName() != null)
+ ref.setJndiName(mgr.getResJndiName());
+ else if(mgr.getResUrl() != null)
+ ref.setResUrl(mgr.getResUrl());
+ }
+ }
+ }
+
+ PersistenceContextReferencesMetaData mergedPcRefs = PersistenceContextReferencesMetaData.merge(jbossPersistenceContextRefs,
+ specPersistenceContextRefs, overridenFile, overrideFile);
+ if (mergedPcRefs != null)
+ this.setPersistenceContextRefs(mergedPcRefs);
+
+ }
+
+ public void merge(JBossEnvironmentRefsGroupMetaData override, JBossEnvironmentRefsGroupMetaData original, ResourceManagersMetaData resourceManagers)
+ {
+ super.merge(override, original, "deployment descriptors", "annotations", false);
+
+ EJBLocalReferencesMetaData originalLocalRefs = null;
+ PersistenceContextReferencesMetaData originalPctxRefs = null;
+ DataSourcesMetaData originalDataSources = null;
+ if(original != null)
+ {
+ originalLocalRefs = original.ejbLocalReferences;
+ originalPctxRefs = original.persistenceContextRefs;
+ originalDataSources = original.dataSources;
+ }
+
+ EJBLocalReferencesMetaData overrideLocalRefs = null;
+ PersistenceContextReferencesMetaData overridePctxRefs = null;
+ DataSourcesMetaData overrideDataSources = null;
+ if(override != null)
+ {
+ overrideLocalRefs = override.ejbLocalReferences;
+ overridePctxRefs = override.persistenceContextRefs;
+ overrideDataSources = override.dataSources;
+ }
+
+ EJBLocalReferencesMetaData mergedEjbLocalRefs = EJBLocalReferencesMetaData.merge(overrideLocalRefs, originalLocalRefs, null, "jboss.xml");
+ if (mergedEjbLocalRefs != null)
+ this.setEjbLocalReferences(mergedEjbLocalRefs);
+
+ PersistenceContextReferencesMetaData mergedPctxRefs = PersistenceContextReferencesMetaData.merge(overridePctxRefs, originalPctxRefs, null, "jboss.xml");
+ if(mergedPctxRefs != null)
+ this.setPersistenceContextRefs(mergedPctxRefs);
+
+ DataSourcesMetaData mergedDataSources = DataSourcesMetaData.merge(overrideDataSources, originalDataSources, null, "jboss.xml");
+ if(mergedDataSources != null)
+ this.setDataSources(mergedDataSources);
+
+ // Need to set the jndi name from resource mgr if referenced
+ ResourceReferencesMetaData jbossResRefs = getResourceReferences();
+ if(resourceManagers != null && jbossResRefs != null)
+ {
+ for(ResourceReferenceMetaData ref : jbossResRefs)
+ {
+ ResourceManagerMetaData mgr = resourceManagers.get(ref.getResourceName());
+ if(mgr != null)
+ {
+ if(mgr.getResJndiName() != null)
+ ref.setJndiName(mgr.getResJndiName());
+ else if(mgr.getResUrl() != null)
+ ref.setResUrl(mgr.getResUrl());
+ }
+ }
+ }
+ }
+}
Copied: projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/javaee/spec (from rev 95641, projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec)
Copied: projects/metadata/common/tags/2.0.0.Alpha3/src/main/java/org/jboss/metadata/javaee/support (from rev 95641, projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/support)
Copied: projects/metadata/common/tags/2.0.0.Alpha3/src/main/resources/schema (from rev 95641, projects/metadata/common/trunk/src/main/resources/schema)
More information about the jboss-cvs-commits
mailing list