[seam-commits] Seam SVN: r8234 - in trunk/src/main/org/jboss/seam: core and 1 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Tue May 20 12:03:03 EDT 2008
Author: pete.muir at jboss.org
Date: 2008-05-20 12:03:03 -0400 (Tue, 20 May 2008)
New Revision: 8234
Modified:
trunk/src/main/org/jboss/seam/core-2.1.xsd
trunk/src/main/org/jboss/seam/core/Manager.java
trunk/src/main/org/jboss/seam/persistence/PersistenceContexts.java
Log:
JBSEAM-2512
Modified: trunk/src/main/org/jboss/seam/core/Manager.java
===================================================================
--- trunk/src/main/org/jboss/seam/core/Manager.java 2008-05-20 15:58:34 UTC (rev 8233)
+++ trunk/src/main/org/jboss/seam/core/Manager.java 2008-05-20 16:03:03 UTC (rev 8234)
@@ -17,6 +17,7 @@
import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.FlushModeType;
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
@@ -68,7 +69,9 @@
private String URIEncoding = DEFAULT_ENCODING;
+ private FlushModeType defaultFlushMode;
+
// DONT BREAK, icefaces uses this
public String getCurrentConversationId()
{
@@ -865,6 +868,16 @@
{
this.concurrentRequestTimeout = requestWait;
}
+
+ public FlushModeType getDefaultFlushMode()
+ {
+ return defaultFlushMode;
+ }
+
+ public void setDefaultFlushMode(FlushModeType defaultFlushMode)
+ {
+ this.defaultFlushMode = defaultFlushMode;
+ }
@Override
public String toString()
Modified: trunk/src/main/org/jboss/seam/core-2.1.xsd
===================================================================
--- trunk/src/main/org/jboss/seam/core-2.1.xsd 2008-05-20 15:58:34 UTC (rev 8233)
+++ trunk/src/main/org/jboss/seam/core-2.1.xsd 2008-05-20 16:03:03 UTC (rev 8234)
@@ -42,6 +42,18 @@
<xs:attribute name="conversation-id-parameter" type="components:string"/>
<xs:attribute name="parent-conversation-id-parameter" type="components:string"/>
<xs:attribute name="uri-encoding" type="components:string" />
+ <xs:attribute name="default-flush-mode">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="manual"/>
+ <xs:enumeration value="auto"/>
+ <xs:enumeration value="commit"/>
+ <xs:enumeration value="MANUAL"/>
+ <xs:enumeration value="AUTO"/>
+ <xs:enumeration value="COMMIT"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
</xs:attributeGroup>
<xs:element name="resource-loader">
Modified: trunk/src/main/org/jboss/seam/persistence/PersistenceContexts.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/PersistenceContexts.java 2008-05-20 15:58:34 UTC (rev 8233)
+++ trunk/src/main/org/jboss/seam/persistence/PersistenceContexts.java 2008-05-20 16:03:03 UTC (rev 8234)
@@ -9,6 +9,7 @@
import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.FlushModeType;
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;
@@ -16,6 +17,7 @@
import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.AbstractMutable;
+import org.jboss.seam.core.Manager;
/**
* Maintains the set of persistence contexts that have been
@@ -32,9 +34,26 @@
{
private static final long serialVersionUID = -4897350516435283182L;
private Set<String> set = new HashSet<String>();
- private FlushModeType flushMode = FlushModeType.AUTO;
- private FlushModeType actualFlushMode = FlushModeType.AUTO;
+ private FlushModeType flushMode;
+ private FlushModeType actualFlushMode;
+ @Create
+ public void create()
+ {
+ FlushModeType defaultFlushMode = Manager.instance().getDefaultFlushMode();
+ if (defaultFlushMode != null)
+ {
+ flushMode = defaultFlushMode;
+ actualFlushMode = defaultFlushMode;
+ }
+ else
+ {
+ flushMode = FlushModeType.AUTO;
+ actualFlushMode = FlushModeType.AUTO;
+ }
+ }
+
+
public FlushModeType getFlushMode()
{
return flushMode;
More information about the seam-commits
mailing list