[jboss-cvs] JBossAS SVN: r109854 - in projects/jpa/tags: 1.0.2-alpha-3 and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sun Dec 12 10:59:39 EST 2010
Author: jaikiran
Date: 2010-12-12 10:59:38 -0500 (Sun, 12 Dec 2010)
New Revision: 109854
Added:
projects/jpa/tags/1.0.2-alpha-3/
projects/jpa/tags/1.0.2-alpha-3/pom.xml
projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java
projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceUnitRefResource.java
Removed:
projects/jpa/tags/1.0.2-alpha-3/pom.xml
projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java
projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceUnitRefResource.java
Modified:
projects/jpa/tags/1.0.2-alpha-3/.classpath
projects/jpa/tags/1.0.2-alpha-3/.project
projects/jpa/tags/1.0.2-alpha-3/.settings/org.eclipse.jdt.core.prefs
projects/jpa/tags/1.0.2-alpha-3/.settings/org.maven.ide.eclipse.prefs
Log:
[maven-release-plugin] copy for tag 1.0.2-alpha-3
Copied: projects/jpa/tags/1.0.2-alpha-3 (from rev 109851, projects/jpa/trunk/deployers)
Modified: projects/jpa/tags/1.0.2-alpha-3/.classpath
===================================================================
--- projects/jpa/trunk/deployers/.classpath 2010-12-12 15:50:21 UTC (rev 109851)
+++ projects/jpa/tags/1.0.2-alpha-3/.classpath 2010-12-12 15:59:38 UTC (rev 109854)
@@ -1,8 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/test/java" output="eclipse-target/tests-classes"/>
- <classpathentry kind="src" path="src/test/resources" output="eclipse-target/tests-classes" excluding="**/*.java"/>
- <classpathentry kind="output" path="eclipse-target/classes"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
-</classpath>
\ No newline at end of file
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/tests-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/tests-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Modified: projects/jpa/tags/1.0.2-alpha-3/.project
===================================================================
--- projects/jpa/trunk/deployers/.project 2010-12-12 15:50:21 UTC (rev 109851)
+++ projects/jpa/tags/1.0.2-alpha-3/.project 2010-12-12 15:59:38 UTC (rev 109854)
@@ -1,20 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>jboss-jpa-deployers</name>
- <comment>The JBoss Container Managed JPA Deployers for deploying persistence units.
+ <name>jboss-jpa-deployers</name>
+ <comment>The JBoss Container Managed JPA Deployers for deploying persistence units.
See EJB 3 JPA chapter 6 and 7.</comment>
- <projects/>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- </buildCommand>
- <!--
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- </buildCommand>
- -->
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
\ No newline at end of file
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: projects/jpa/tags/1.0.2-alpha-3/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jpa/trunk/deployers/.settings/org.eclipse.jdt.core.prefs 2010-12-12 15:50:21 UTC (rev 109851)
+++ projects/jpa/tags/1.0.2-alpha-3/.settings/org.eclipse.jdt.core.prefs 2010-12-12 15:59:38 UTC (rev 109854)
@@ -1,5 +1,3 @@
-#Fri Jun 27 12:12:33 CEST 2008
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+#Wed Nov 24 21:47:06 IST 2010
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.source=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
Modified: projects/jpa/tags/1.0.2-alpha-3/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jpa/trunk/deployers/.settings/org.maven.ide.eclipse.prefs 2010-12-12 15:50:21 UTC (rev 109851)
+++ projects/jpa/tags/1.0.2-alpha-3/.settings/org.maven.ide.eclipse.prefs 2010-12-12 15:59:38 UTC (rev 109854)
@@ -1,8 +1,9 @@
-#Thu Sep 11 10:13:35 CEST 2008
-activeProfiles=eclipse
+#Sat Sep 04 13:49:08 IST 2010
+activeProfiles=
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false
resolveWorkspaceProjects=true
resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
version=1
Deleted: projects/jpa/tags/1.0.2-alpha-3/pom.xml
===================================================================
--- projects/jpa/trunk/deployers/pom.xml 2010-12-12 15:50:21 UTC (rev 109851)
+++ projects/jpa/tags/1.0.2-alpha-3/pom.xml 2010-12-12 15:59:38 UTC (rev 109854)
@@ -1,166 +0,0 @@
-<!--
- vi:ts=2:sw=2:expandtab
--->
-<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.jpa</groupId>
- <artifactId>jboss-jpa-build</artifactId>
- <relativePath>../build/pom.xml</relativePath>
- <version>1.0.1</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>jboss-jpa-deployers</artifactId>
- <version>1.0.2-SNAPSHOT</version>
- <packaging>jar</packaging>
- <name>JBoss Container Managed JPA Deployers</name>
- <description>
- The JBoss Container Managed JPA Deployers for deploying persistence units.
- See EJB 3 JPA chapter 6 and 7.
- </description>
-
- <properties>
- <version.org.jboss.deployers>2.0.5.GA</version.org.jboss.deployers>
- <version.switchboard>1.0.0-alpha-8</version.switchboard>
- </properties>
-
- <dependencies>
- <!-- For 'mocking' a TransactionManager we use JBossTS -->
- <dependency>
- <groupId>jboss.jbossts</groupId>
- <artifactId>jbossjta</artifactId>
- <version>4.4.0.GA</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- <scope>test</scope>
- </dependency>
- <!-- For 'mocking' a DataSource we use Derby -->
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.4.1.3</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <version>${version.org.hibernate.hibernate-entitymanager}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.integration</groupId>
- <artifactId>jboss-transaction-spi</artifactId>
- <version>5.0.3.GA</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-test</artifactId>
- <version>1.0.5.GA</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- <version>${version.org.jboss.deployers}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- <version>${version.org.jboss.deployers}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.jpa</groupId>
- <artifactId>jboss-jpa-impl</artifactId>
- <version>1.0.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.jpa</groupId>
- <artifactId>jboss-jpa-spi</artifactId>
- <version>1.0.0</version>
- <!-- TODO: we should really use the right jpa-spi -->
- <exclusions>
- <exclusion>
- <groupId>org.hibernate</groupId>
- <artifactId>ejb3-persistence</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.metadata</groupId>
- <artifactId>jboss-metadata</artifactId>
- <version>1.0.0.CR17</version>
- <exclusions>
- <exclusion>
- <groupId>org.hibernate</groupId>
- <artifactId>ejb3-persistence</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- For @JMX -->
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-aop-mc-int</artifactId>
- <version>2.0.4.GA</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.naming</groupId>
- <artifactId>jnpserver</artifactId>
- <version>5.0.1.GA</version>
- <scope>test</scope>
- </dependency>
-
- <!-- For Arjuna / JBoss Transaction -->
- <dependency>
- <groupId>apache-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.0.jboss</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>oswego-concurrent</groupId>
- <artifactId>concurrent</artifactId>
- <version>1.3.4-jboss-update1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss.jbossts</groupId>
- <artifactId>jbossts-common</artifactId>
- <version>4.4.0.GA</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Hibernate core logging -->
- <dependency>
- <groupId>org.jboss.slf4j</groupId>
- <artifactId>slf4j-jboss-logging</artifactId>
- <version>1.0.0.GA</version>
- <scope>test</scope>
- </dependency>
-
- <!-- jboss-common-core (For JNDI Utils) -->
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>2.2.11.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.switchboard</groupId>
- <artifactId>jboss-switchboard-mc-spi</artifactId>
- <version>${version.switchboard}</version>
- </dependency>
-
- <!-- switchboard -->
- <dependency>
- <groupId>org.jboss.switchboard</groupId>
- <artifactId>jboss-switchboard-javaee</artifactId>
- <version>${version.switchboard}</version>
- </dependency>
-
-
- </dependencies>
-</project>
Copied: projects/jpa/tags/1.0.2-alpha-3/pom.xml (from rev 109853, projects/jpa/trunk/deployers/pom.xml)
===================================================================
--- projects/jpa/tags/1.0.2-alpha-3/pom.xml (rev 0)
+++ projects/jpa/tags/1.0.2-alpha-3/pom.xml 2010-12-12 15:59:38 UTC (rev 109854)
@@ -0,0 +1,172 @@
+<!--
+ vi:ts=2:sw=2:expandtab
+-->
+<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.jpa</groupId>
+ <artifactId>jboss-jpa-build</artifactId>
+ <relativePath>../build/pom.xml</relativePath>
+ <version>1.0.1</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>jboss-jpa-deployers</artifactId>
+ <version>1.0.2-alpha-3</version>
+ <packaging>jar</packaging>
+ <name>JBoss Container Managed JPA Deployers</name>
+ <description>
+ The JBoss Container Managed JPA Deployers for deploying persistence units.
+ See EJB 3 JPA chapter 6 and 7.
+ </description>
+
+ <properties>
+ <version.org.jboss.deployers>2.0.5.GA</version.org.jboss.deployers>
+ <version.switchboard>1.0.0-alpha-14</version.switchboard>
+ </properties>
+
+ <dependencies>
+ <!-- For 'mocking' a TransactionManager we use JBossTS -->
+ <dependency>
+ <groupId>jboss.jbossts</groupId>
+ <artifactId>jbossjta</artifactId>
+ <version>4.4.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- For 'mocking' a DataSource we use Derby -->
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.4.1.3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>${version.org.hibernate.hibernate-entitymanager}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-transaction-spi</artifactId>
+ <version>5.0.3.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-test</artifactId>
+ <version>1.0.5.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ <version>${version.org.jboss.deployers}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ <version>${version.org.jboss.deployers}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jpa</groupId>
+ <artifactId>jboss-jpa-impl</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jpa</groupId>
+ <artifactId>jboss-jpa-spi</artifactId>
+ <version>1.0.0</version>
+ <!-- TODO: we should really use the right jpa-spi -->
+ <exclusions>
+ <exclusion>
+ <groupId>org.hibernate</groupId>
+ <artifactId>ejb3-persistence</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.metadata</groupId>
+ <artifactId>jboss-metadata</artifactId>
+ <version>1.0.0.CR17</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.hibernate</groupId>
+ <artifactId>ejb3-persistence</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- For @JMX -->
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-aop-mc-int</artifactId>
+ <version>2.0.4.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.naming</groupId>
+ <artifactId>jnpserver</artifactId>
+ <version>5.0.1.GA</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- For Arjuna / JBoss Transaction -->
+ <dependency>
+ <groupId>apache-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.0.jboss</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>oswego-concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <version>1.3.4-jboss-update1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossts</groupId>
+ <artifactId>jbossts-common</artifactId>
+ <version>4.4.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Hibernate core logging -->
+ <dependency>
+ <groupId>org.jboss.slf4j</groupId>
+ <artifactId>slf4j-jboss-logging</artifactId>
+ <version>1.0.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- jboss-common-core (For JNDI Utils) -->
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>2.2.11.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.switchboard</groupId>
+ <artifactId>jboss-switchboard-mc-spi</artifactId>
+ <version>${version.switchboard}</version>
+ </dependency>
+
+ <!-- switchboard -->
+ <dependency>
+ <groupId>org.jboss.switchboard</groupId>
+ <artifactId>jboss-switchboard-javaee</artifactId>
+ <version>${version.switchboard}</version>
+ </dependency>
+
+
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jpa/tags/1.0.2-alpha-3</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jpa/tags/1.0.2-alpha-3</developerConnection>
+ <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jpa/tags/1.0.2-alpha-3</url>
+ </scm>
+</project>
Deleted: projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java
===================================================================
--- projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java 2010-12-12 15:50:21 UTC (rev 109851)
+++ projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java 2010-12-12 15:59:38 UTC (rev 109854)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.jpa.deployers.switchboard;
-
-import org.jboss.jpa.deployment.ManagedEntityManagerFactory;
-import org.jboss.jpa.deployment.PersistenceUnitDeployment;
-import org.jboss.jpa.spi.PersistenceUnitRegistry;
-import org.jboss.switchboard.javaee.environment.PersistenceContextRefType;
-import org.jboss.switchboard.spi.Resource;
-
-import javax.persistence.PersistenceContextType;
-
-/**
- *
- * <p>
- *
- * </p>
- *
- * @author Scott Marlow
- */
-public class PersistenceContextRefResource implements Resource
-{
-
- private final String puSupplier;
- private final PersistenceContextRefType pcRef;
-
- public PersistenceContextRefResource(String puSupplier, PersistenceContextRefType pcRef)
- {
- if (puSupplier == null)
- {
- throw new IllegalArgumentException("Cannot create a PersistenceUnitRefResource for a null persistence unit supplier");
- }
- this.puSupplier = puSupplier;
- this.pcRef = pcRef;
- }
-
- @Override
- public Object getDependency()
- {
- // We need the PersistenceUnitDeployer MC bean to be started before we can bind
- // the PersistenceUnitDeployment.getManagedFactory().getEntityManagerFactory() to JNDI
- return puSupplier;
- }
-
- @Override
- public Object getTarget()
- {
- boolean extendedPc = PersistenceContextType.EXTENDED.equals(pcRef.getPersistenceContextType());
- if (extendedPc)
- {
- // clearly this is wrong, since the non-extended case returns a factory that can be bound.
- // hmm, I wonder if the else case already has the knowledge to return a factory that later returns
- // the extended PC
- return PersistenceUnitRegistry.getPersistenceUnit(puSupplier).getXPCResolver().getExtendedPersistenceContext(puSupplier);
- }
- else
- {
- ManagedEntityManagerFactory managedEntityManagerFactory = ((PersistenceUnitDeployment)PersistenceUnitRegistry.getPersistenceUnit(puSupplier)).getManagedFactory();
- return managedEntityManagerFactory.getEntityManagerFactory();
- }
- }
-
- @Override
- public String toString()
- {
- boolean extendedPc = PersistenceContextType.EXTENDED.equals(pcRef.getPersistenceContextType());
- return PersistenceContextRefResource.class.getSimpleName() + (extendedPc?"(extendedPC)":"")+"[supplier=" + this.puSupplier + "]";
- }
-}
Copied: projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java (from rev 109852, projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java)
===================================================================
--- projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java (rev 0)
+++ projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java 2010-12-12 15:59:38 UTC (rev 109854)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jpa.deployers.switchboard;
+
+import java.util.Collection;
+
+import javax.persistence.PersistenceContextType;
+
+import org.jboss.jpa.deployment.ManagedEntityManagerFactory;
+import org.jboss.jpa.deployment.PersistenceUnitDeployment;
+import org.jboss.jpa.spi.PersistenceUnitRegistry;
+import org.jboss.switchboard.javaee.environment.PersistenceContextRefType;
+import org.jboss.switchboard.spi.Resource;
+
+/**
+ *
+ * <p>
+ *
+ * </p>
+ *
+ * @author Scott Marlow
+ */
+public class PersistenceContextRefResource implements Resource
+{
+
+ private final String puSupplier;
+ private final PersistenceContextRefType pcRef;
+
+ public PersistenceContextRefResource(String puSupplier, PersistenceContextRefType pcRef)
+ {
+ if (puSupplier == null)
+ {
+ throw new IllegalArgumentException("Cannot create a PersistenceUnitRefResource for a null persistence unit supplier");
+ }
+ this.puSupplier = puSupplier;
+ this.pcRef = pcRef;
+ }
+
+ @Override
+ public Object getDependency()
+ {
+ // We need the PersistenceUnitDeployer MC bean to be started before we can bind
+ // the PersistenceUnitDeployment.getManagedFactory().getEntityManagerFactory() to JNDI
+ return puSupplier;
+ }
+
+ @Override
+ public Object getTarget()
+ {
+ boolean extendedPc = PersistenceContextType.EXTENDED.equals(pcRef.getPersistenceContextType());
+ if (extendedPc)
+ {
+ // clearly this is wrong, since the non-extended case returns a factory that can be bound.
+ // hmm, I wonder if the else case already has the knowledge to return a factory that later returns
+ // the extended PC
+ return PersistenceUnitRegistry.getPersistenceUnit(puSupplier).getXPCResolver().getExtendedPersistenceContext(puSupplier);
+ }
+ else
+ {
+ ManagedEntityManagerFactory managedEntityManagerFactory = ((PersistenceUnitDeployment)PersistenceUnitRegistry.getPersistenceUnit(puSupplier)).getManagedFactory();
+ return managedEntityManagerFactory.getEntityManagerFactory();
+ }
+ }
+
+ @Override
+ public String toString()
+ {
+ boolean extendedPc = PersistenceContextType.EXTENDED.equals(pcRef.getPersistenceContextType());
+ return PersistenceContextRefResource.class.getSimpleName() + (extendedPc?"(extendedPC)":"")+"[supplier=" + this.puSupplier + "]";
+ }
+
+ @Override
+ public Collection<?> getInvocationDependencies()
+ {
+ return null;
+ }
+
+}
Deleted: projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceUnitRefResource.java
===================================================================
--- projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceUnitRefResource.java 2010-12-12 15:50:21 UTC (rev 109851)
+++ projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceUnitRefResource.java 2010-12-12 15:59:38 UTC (rev 109854)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.jpa.deployers.switchboard;
-
-import org.jboss.jpa.deployment.ManagedEntityManagerFactory;
-import org.jboss.jpa.deployment.PersistenceUnitDeployment;
-import org.jboss.jpa.spi.PersistenceUnitRegistry;
-import org.jboss.switchboard.spi.Resource;
-
-/**
- *
- * <p>
- *
- * </p>
- *
- * @author Scott Marlow
- */
-public class PersistenceUnitRefResource implements Resource
-{
-
- private final String puSupplier;
-
- public PersistenceUnitRefResource(String puSupplier)
- {
- if (puSupplier == null)
- {
- throw new IllegalArgumentException("Cannot create a PersistenceUnitRefResource for a null persistence unit supplier");
- }
- this.puSupplier = puSupplier;
- }
-
- @Override
- public Object getDependency()
- {
- // We need the PersistenceUnitDeployer MC bean to be started before we can bind
- // the PersistenceUnitDeployment.getManagedFactory().getEntityManagerFactory() to JNDI
- return puSupplier;
- }
-
- @Override
- public Object getTarget()
- {
- ManagedEntityManagerFactory managedEntityManagerFactory = ((PersistenceUnitDeployment)PersistenceUnitRegistry.getPersistenceUnit(puSupplier)).getManagedFactory();
- return managedEntityManagerFactory.getEntityManagerFactory();
- }
-
- @Override
- public String toString()
- {
- return PersistenceUnitRefResource.class.getSimpleName() + "[supplier=" + this.puSupplier + "]";
- }
-}
Copied: projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceUnitRefResource.java (from rev 109852, projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceUnitRefResource.java)
===================================================================
--- projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceUnitRefResource.java (rev 0)
+++ projects/jpa/tags/1.0.2-alpha-3/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceUnitRefResource.java 2010-12-12 15:59:38 UTC (rev 109854)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jpa.deployers.switchboard;
+
+import java.util.Collection;
+
+import org.jboss.jpa.deployment.ManagedEntityManagerFactory;
+import org.jboss.jpa.deployment.PersistenceUnitDeployment;
+import org.jboss.jpa.spi.PersistenceUnitRegistry;
+import org.jboss.switchboard.spi.Resource;
+
+/**
+ *
+ * <p>
+ *
+ * </p>
+ *
+ * @author Scott Marlow
+ */
+public class PersistenceUnitRefResource implements Resource
+{
+
+ private final String puSupplier;
+
+ public PersistenceUnitRefResource(String puSupplier)
+ {
+ if (puSupplier == null)
+ {
+ throw new IllegalArgumentException("Cannot create a PersistenceUnitRefResource for a null persistence unit supplier");
+ }
+ this.puSupplier = puSupplier;
+ }
+
+ @Override
+ public Object getDependency()
+ {
+ // We need the PersistenceUnitDeployer MC bean to be started before we can bind
+ // the PersistenceUnitDeployment.getManagedFactory().getEntityManagerFactory() to JNDI
+ return puSupplier;
+ }
+
+ @Override
+ public Object getTarget()
+ {
+ ManagedEntityManagerFactory managedEntityManagerFactory = ((PersistenceUnitDeployment)PersistenceUnitRegistry.getPersistenceUnit(puSupplier)).getManagedFactory();
+ return managedEntityManagerFactory.getEntityManagerFactory();
+ }
+
+ @Override
+ public String toString()
+ {
+ return PersistenceUnitRefResource.class.getSimpleName() + "[supplier=" + this.puSupplier + "]";
+ }
+
+ @Override
+ public Collection<?> getInvocationDependencies()
+ {
+ return null;
+ }
+
+}
More information about the jboss-cvs-commits
mailing list