[seam-commits] Seam SVN: r13576 - in modules/persistence/trunk: api/src/main/java/org/jboss/seam/persistence and 2 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Fri Aug 6 23:15:10 EDT 2010
Author: swd847
Date: 2010-08-06 23:15:09 -0400 (Fri, 06 Aug 2010)
New Revision: 13576
Added:
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/SeamManaged.java
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/FlushModeType.java
modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/PersistenceContexts.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java
Removed:
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeType.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/SeamManaged.java
Modified:
modules/persistence/trunk/api/pom.xml
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManager.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContext.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextProxyHandler.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceProvider.java
Log:
update the API
Modified: modules/persistence/trunk/api/pom.xml
===================================================================
--- modules/persistence/trunk/api/pom.xml 2010-08-07 02:15:38 UTC (rev 13575)
+++ modules/persistence/trunk/api/pom.xml 2010-08-07 03:15:09 UTC (rev 13576)
@@ -23,7 +23,11 @@
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
Copied: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/SeamManaged.java (from rev 13554, modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/SeamManaged.java)
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/SeamManaged.java (rev 0)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/SeamManaged.java 2010-08-07 03:15:09 UTC (rev 13576)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., 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.seam.persistence;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.Dependent;
+import javax.persistence.EntityManagerFactory;
+
+/**
+ * Signifies that a resource producer field or producer method that produces an
+ * {@link EntityManagerFactory} should also produce a Seam managed persistence
+ * context. For example:
+ *
+ * <pre>
+ * @SeamManaged
+ * @Produces
+ * @PersistenceUnit
+ * @ConversationScoped
+ * @SomeQualifier
+ * EntityManagerFactory emf;
+ * </pre>
+ *
+ * will create a conversation scoped seam managed persistence context that is
+ * conversation scoped with the qualifier @SomeQualifier.
+ *
+ * This field still produces the EntityManagerFactory with qualifier
+ *
+ * @SomeQualifier, however the scope for the producer field is changed to
+ * {@link Dependent}, as the specification does not allow
+ * resource producer fields to have a scope other than Depedent
+ *
+ * @author Stuart Douglas
+ *
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target( { ElementType.FIELD, ElementType.METHOD })
+ at Documented
+public @interface SeamManaged
+{
+
+}
Copied: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/FlushModeType.java (from rev 13555, modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeType.java)
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/FlushModeType.java (rev 0)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/FlushModeType.java 2010-08-07 03:15:09 UTC (rev 13576)
@@ -0,0 +1,42 @@
+package org.jboss.seam.persistence.transaction;
+
+/**
+ * A full set of flush modes, including MANUAL,
+ * which is a glaring missing feature of the JPA
+ * spec.
+ *
+ * @author Gavin King
+ *
+ */
+public enum FlushModeType
+{
+
+ /**
+ * Flushing never occurs automatically, all changes are queued
+ * until the application calls flush() explicitly.
+ */
+ MANUAL,
+
+ /**
+ * Flushing occurs automatically at commit time and when necessary
+ * before query executions.
+ */
+ AUTO,
+
+ /**
+ * Flushing occurs automatically at transaction commit time.
+ */
+ COMMIT;
+
+ /**
+ * Does this flush mode keep unflushed changes past a
+ * transaction commit?
+ *
+ * @return false for all flush modes except for MANUAL
+ */
+ public boolean dirtyBetweenTransactions()
+ {
+ return this==MANUAL;
+ }
+
+}
Added: modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/PersistenceContexts.java
===================================================================
--- modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/PersistenceContexts.java (rev 0)
+++ modules/persistence/trunk/api/src/main/java/org/jboss/seam/persistence/transaction/PersistenceContexts.java 2010-08-07 03:15:09 UTC (rev 13576)
@@ -0,0 +1,23 @@
+package org.jboss.seam.persistence.transaction;
+
+
+public interface PersistenceContexts
+{
+
+ public abstract FlushModeType getFlushMode();
+
+ public abstract void changeFlushMode(FlushModeType flushMode);
+
+ public abstract void changeFlushMode(FlushModeType flushMode, boolean temporary);
+
+ /**
+ * Restore the previous flush mode if the current flush mode is marked as
+ * temporary.
+ */
+ public abstract void restoreFlushMode();
+
+ public abstract void beforeRender();
+
+ public abstract void afterRender();
+
+}
\ No newline at end of file
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManager.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManager.java 2010-08-07 02:15:38 UTC (rev 13575)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeManager.java 2010-08-07 03:15:09 UTC (rev 13576)
@@ -25,6 +25,8 @@
import javax.enterprise.context.ApplicationScoped;
+import org.jboss.seam.persistence.transaction.FlushModeType;
+
/**
* Provides for programmatic configuration of the default flush mode.
*
Deleted: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeType.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeType.java 2010-08-07 02:15:38 UTC (rev 13575)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/FlushModeType.java 2010-08-07 03:15:09 UTC (rev 13576)
@@ -1,42 +0,0 @@
-package org.jboss.seam.persistence;
-
-/**
- * A full set of flush modes, including MANUAL,
- * which is a glaring missing feature of the JPA
- * spec.
- *
- * @author Gavin King
- *
- */
-public enum FlushModeType
-{
-
- /**
- * Flushing never occurs automatically, all changes are queued
- * until the application calls flush() explicitly.
- */
- MANUAL,
-
- /**
- * Flushing occurs automatically at commit time and when necessary
- * before query executions.
- */
- AUTO,
-
- /**
- * Flushing occurs automatically at transaction commit time.
- */
- COMMIT;
-
- /**
- * Does this flush mode keep unflushed changes past a
- * transaction commit?
- *
- * @return false for all flush modes except for MANUAL
- */
- public boolean dirtyBetweenTransactions()
- {
- return this==MANUAL;
- }
-
-}
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2010-08-07 02:15:38 UTC (rev 13575)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2010-08-07 03:15:09 UTC (rev 13576)
@@ -16,6 +16,7 @@
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.type.VersionType;
+import org.jboss.seam.persistence.transaction.FlushModeType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -32,7 +33,7 @@
{
@Inject
- Instance<PersistenceContexts> persistenceContexts;
+ Instance<PersistenceContextsImpl> persistenceContexts;
private static Logger log = LoggerFactory.getLogger(HibernatePersistenceProvider.class);
private static Class FULL_TEXT_SESSION_PROXY_CLASS;
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContext.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContext.java 2010-08-07 02:15:38 UTC (rev 13575)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContext.java 2010-08-07 03:15:09 UTC (rev 13576)
@@ -24,6 +24,8 @@
import java.lang.annotation.Annotation;
import java.util.Set;
+import org.jboss.seam.persistence.transaction.FlushModeType;
+
/**
* Support for changing flushmodes for an existing persistence context.
*
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextProxyHandler.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextProxyHandler.java 2010-08-07 02:15:38 UTC (rev 13575)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextProxyHandler.java 2010-08-07 03:15:09 UTC (rev 13576)
@@ -29,6 +29,7 @@
import javax.persistence.EntityManager;
import javax.persistence.Query;
+import org.jboss.seam.persistence.transaction.FlushModeType;
import org.jboss.seam.persistence.util.InstanceResolver;
import org.jboss.weld.extensions.el.Expressions;
import org.slf4j.Logger;
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java 2010-08-07 02:15:38 UTC (rev 13575)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java 2010-08-07 03:15:09 UTC (rev 13576)
@@ -1,205 +1,38 @@
package org.jboss.seam.persistence;
-import java.io.Serializable;
-import java.lang.annotation.Annotation;
-import java.util.Collections;
-import java.util.HashSet;
import java.util.Set;
-import javax.enterprise.context.ConversationScoped;
-import javax.enterprise.inject.Any;
-import javax.enterprise.inject.Instance;
-import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.jboss.seam.persistence.PersistenceContextsImpl.PersistenceContextDefintition;
+import org.jboss.seam.persistence.transaction.FlushModeType;
-/**
- * Maintains the set of persistence contexts that have been touched in a
- * conversation. Also controls the flush mode used by the persistence contexts
- * during the render phase.
- *
- * @author Gavin King
- */
- at ConversationScoped
-public class PersistenceContexts implements Serializable
+public interface PersistenceContexts
{
- private static final long serialVersionUID = -4897350516435283182L;
- private static final Logger log = LoggerFactory.getLogger(PersistenceContexts.class);
- /**
- * persistences contexts are referenced by their qualifiers
- */
- private Set<PersistenceContextDefintition> set = new HashSet<PersistenceContextDefintition>();
- private FlushModeType flushMode;
-
- // the real flush mode is a backup of the flush mode when doing a temporary
- // switch (such as during render)
- private FlushModeType realFlushMode;
-
@Inject
- BeanManager beanManager;
+ public abstract void create(FlushModeManager manager);
- @Inject
- @Any
- Instance<PersistenceContext> persistenceContexts;
+ public abstract FlushModeType getFlushMode();
- @Inject
- Instance<PersistenceProvider> persistenceProvider;
+ public abstract Set<PersistenceContextDefintition> getTouchedContexts();
- @Inject
- public void create(FlushModeManager manager)
- {
- FlushModeType defaultFlushMode = manager.getFlushModeType();
- if (defaultFlushMode != null)
- {
- flushMode = defaultFlushMode;
- }
- else
- {
- flushMode = FlushModeType.AUTO;
- }
- }
+ public abstract void touch(PersistenceContext context);
- public FlushModeType getFlushMode()
- {
- return flushMode;
- }
+ public abstract void untouch(PersistenceContext context);
- public Set<PersistenceContextDefintition> getTouchedContexts()
- {
- return Collections.unmodifiableSet(set);
- }
+ public abstract void changeFlushMode(FlushModeType flushMode);
- public void touch(PersistenceContext context)
- {
- set.add(new PersistenceContextDefintition(context.getQualifiers(), context.getBeanType()));
- }
+ public abstract void changeFlushMode(FlushModeType flushMode, boolean temporary);
- public void untouch(PersistenceContext context)
- {
- set.remove(new PersistenceContextDefintition(context.getQualifiers(), context.getBeanType()));
- }
-
- public void changeFlushMode(FlushModeType flushMode)
- {
- changeFlushMode(flushMode, false);
- }
-
- public void changeFlushMode(FlushModeType flushMode, boolean temporary)
- {
- if (temporary)
- {
- realFlushMode = this.flushMode;
- }
- this.flushMode = flushMode;
- changeFlushModes();
- }
-
/**
* Restore the previous flush mode if the current flush mode is marked as
* temporary.
*/
- public void restoreFlushMode()
- {
- if (realFlushMode != null && realFlushMode != flushMode)
- {
- flushMode = realFlushMode;
- realFlushMode = null;
- changeFlushModes();
- }
- }
+ public abstract void restoreFlushMode();
- private void changeFlushModes()
- {
+ public abstract void beforeRender();
- for (PersistenceContext context : persistenceContexts)
- {
- if (set.contains(new PersistenceContextDefintition(context.getQualifiers(), context.getBeanType())))
- try
- {
- context.changeFlushMode(flushMode);
- }
- catch (UnsupportedOperationException uoe)
- {
- // we won't be nasty and throw and exception, but we'll log a
- // warning to the developer
- log.warn(uoe.getMessage());
- }
- }
- }
+ public abstract void afterRender();
- public void beforeRender()
- {
- // some JPA providers may not support MANUAL flushing
- // defer the decision to the provider manager component
- persistenceProvider.get().setRenderFlushMode();
- }
-
- public void afterRender()
- {
- restoreFlushMode();
- }
-
- public static class PersistenceContextDefintition
- {
- private final Set<Annotation> qualifiers;
- private final Class<?> type;
-
- public PersistenceContextDefintition(Set<Annotation> qualifiers, Class<?> type)
- {
- this.qualifiers = new HashSet<Annotation>(qualifiers);
- this.type = type;
- }
-
- public Set<Annotation> getQualifiers()
- {
- return qualifiers;
- }
-
- public Class<?> getType()
- {
- return type;
- }
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((qualifiers == null) ? 0 : qualifiers.hashCode());
- result = prime * result + ((type == null) ? 0 : type.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- PersistenceContextDefintition other = (PersistenceContextDefintition) obj;
- if (qualifiers == null)
- {
- if (other.qualifiers != null)
- return false;
- }
- else if (!qualifiers.equals(other.qualifiers))
- return false;
- if (type == null)
- {
- if (other.type != null)
- return false;
- }
- else if (!type.equals(other.type))
- return false;
- return true;
- }
-
- }
-
-}
+}
\ No newline at end of file
Copied: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java (from rev 13555, modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContexts.java)
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java (rev 0)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java 2010-08-07 03:15:09 UTC (rev 13576)
@@ -0,0 +1,202 @@
+package org.jboss.seam.persistence;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.context.ConversationScoped;
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+
+import org.jboss.seam.persistence.transaction.FlushModeType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Maintains the set of persistence contexts that have been touched in a
+ * conversation. Also controls the flush mode used by the persistence contexts
+ * during the render phase.
+ *
+ * @author Gavin King
+ */
+ at ConversationScoped
+public class PersistenceContextsImpl implements Serializable, PersistenceContexts
+{
+ private static final long serialVersionUID = -4897350516435283182L;
+ private static final Logger log = LoggerFactory.getLogger(PersistenceContextsImpl.class);
+ /**
+ * persistences contexts are referenced by their qualifiers
+ */
+ private Set<PersistenceContextDefintition> set = new HashSet<PersistenceContextDefintition>();
+
+ private FlushModeType flushMode;
+
+ // the real flush mode is a backup of the flush mode when doing a temporary
+ // switch (such as during render)
+ private FlushModeType realFlushMode;
+
+ @Inject
+ BeanManager beanManager;
+
+ @Inject
+ @Any
+ Instance<PersistenceContext> persistenceContexts;
+
+ @Inject
+ Instance<PersistenceProvider> persistenceProvider;
+
+ @Inject
+ public void create(FlushModeManager manager)
+ {
+ FlushModeType defaultFlushMode = manager.getFlushModeType();
+ if (defaultFlushMode != null)
+ {
+ flushMode = defaultFlushMode;
+ }
+ else
+ {
+ flushMode = FlushModeType.AUTO;
+ }
+ }
+
+ public FlushModeType getFlushMode()
+ {
+ return flushMode;
+ }
+
+ public Set<PersistenceContextDefintition> getTouchedContexts()
+ {
+ return Collections.unmodifiableSet(set);
+ }
+
+ public void touch(PersistenceContext context)
+ {
+ set.add(new PersistenceContextDefintition(context.getQualifiers(), context.getBeanType()));
+ }
+
+ public void untouch(PersistenceContext context)
+ {
+ set.remove(new PersistenceContextDefintition(context.getQualifiers(), context.getBeanType()));
+ }
+
+ public void changeFlushMode(FlushModeType flushMode)
+ {
+ changeFlushMode(flushMode, false);
+ }
+
+ public void changeFlushMode(FlushModeType flushMode, boolean temporary)
+ {
+ if (temporary)
+ {
+ realFlushMode = this.flushMode;
+ }
+ this.flushMode = flushMode;
+ changeFlushModes();
+ }
+
+ public void restoreFlushMode()
+ {
+ if (realFlushMode != null && realFlushMode != flushMode)
+ {
+ flushMode = realFlushMode;
+ realFlushMode = null;
+ changeFlushModes();
+ }
+ }
+
+ private void changeFlushModes()
+ {
+
+ for (PersistenceContext context : persistenceContexts)
+ {
+ if (set.contains(new PersistenceContextDefintition(context.getQualifiers(), context.getBeanType())))
+ try
+ {
+ context.changeFlushMode(flushMode);
+ }
+ catch (UnsupportedOperationException uoe)
+ {
+ // we won't be nasty and throw and exception, but we'll log a
+ // warning to the developer
+ log.warn(uoe.getMessage());
+ }
+ }
+ }
+
+ public void beforeRender()
+ {
+ // some JPA providers may not support MANUAL flushing
+ // defer the decision to the provider manager component
+ persistenceProvider.get().setRenderFlushMode();
+ }
+
+ public void afterRender()
+ {
+ restoreFlushMode();
+ }
+
+ public static class PersistenceContextDefintition
+ {
+ private final Set<Annotation> qualifiers;
+ private final Class<?> type;
+
+ public PersistenceContextDefintition(Set<Annotation> qualifiers, Class<?> type)
+ {
+ this.qualifiers = new HashSet<Annotation>(qualifiers);
+ this.type = type;
+ }
+
+ public Set<Annotation> getQualifiers()
+ {
+ return qualifiers;
+ }
+
+ public Class<?> getType()
+ {
+ return type;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((qualifiers == null) ? 0 : qualifiers.hashCode());
+ result = prime * result + ((type == null) ? 0 : type.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PersistenceContextDefintition other = (PersistenceContextDefintition) obj;
+ if (qualifiers == null)
+ {
+ if (other.qualifiers != null)
+ return false;
+ }
+ else if (!qualifiers.equals(other.qualifiers))
+ return false;
+ if (type == null)
+ {
+ if (other.type != null)
+ return false;
+ }
+ else if (!type.equals(other.type))
+ return false;
+ return true;
+ }
+
+ }
+
+}
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceProvider.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceProvider.java 2010-08-07 02:15:38 UTC (rev 13575)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceProvider.java 2010-08-07 03:15:09 UTC (rev 13576)
@@ -31,6 +31,8 @@
import javax.persistence.PersistenceContexts;
import javax.transaction.Synchronization;
+import org.jboss.seam.persistence.transaction.FlushModeType;
+
/**
* Abstraction layer for persistence providers (JPA implementations). This class
* provides a working base implementation that can be optimized for performance
Deleted: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/SeamManaged.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/SeamManaged.java 2010-08-07 02:15:38 UTC (rev 13575)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/SeamManaged.java 2010-08-07 03:15:09 UTC (rev 13576)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., 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.seam.persistence;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.enterprise.context.Dependent;
-import javax.persistence.EntityManagerFactory;
-
-/**
- * Signifies that a resource producer field or producer method that produces an
- * {@link EntityManagerFactory} should also produce a Seam managed persistence
- * context. For example:
- *
- * <pre>
- * @SeamManaged
- * @Produces
- * @PersistenceUnit
- * @ConversationScoped
- * @SomeQualifier
- * EntityManagerFactory emf;
- * </pre>
- *
- * will create a conversation scoped seam managed persistence context that is
- * conversation scoped with the qualifier @SomeQualifier.
- *
- * This field still produces the EntityManagerFactory with qualifier
- *
- * @SomeQualifier, however the scope for the producer field is changed to
- * {@link Dependent}, as the specification does not allow
- * resource producer fields to have a scope other than Depedent
- *
- * @author Stuart Douglas
- *
- */
- at Retention(RetentionPolicy.RUNTIME)
- at Target( { ElementType.FIELD, ElementType.METHOD })
- at Documented
-public @interface SeamManaged
-{
-
-}
More information about the seam-commits
mailing list