Skip to content

Commit

Permalink
Seam managed transactions, no tests yet
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Aug 9, 2010
1 parent 4a7244a commit 491e64c
Show file tree
Hide file tree
Showing 5 changed files with 331 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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.faces.transaction;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Configuration annotation for seam managed transactions
*
* @author Stuart Douglas
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface SeamManagedTransaction
{
SeamManagedTransactionType value();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* 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.faces.transaction;

/**
*
* @author Stuart Douglas
*
*/
public enum SeamManagedTransactionType
{

ENABLED, DISABLED,
/**
* Transactions are only enabled during the RENDER_RESPONSE phase
*/
RENDER_RESPONSE;
}
101 changes: 56 additions & 45 deletions impl/pom.xml
Original file line number Diff line number Diff line change
@@ -1,59 +1,70 @@
<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>
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>seam-faces-parent</artifactId>
<groupId>org.jboss.seam.faces</groupId>
<version>3.0.0-SNAPSHOT</version>
<parent>
<artifactId>seam-faces-parent</artifactId>
<groupId>org.jboss.seam.faces</groupId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
</parent>

<artifactId>seam-faces</artifactId>
<version>3.0.0-SNAPSHOT</version>
<artifactId>seam-faces</artifactId>
<version>3.0.0-SNAPSHOT</version>

<packaging>jar</packaging>
<name>Seam Faces Module Core Implementation</name>
<packaging>jar</packaging>
<name>Seam Faces Module Core Implementation</name>

<dependencies>
<dependency>
<dependencies>
<dependency>
<!-- Required until the Servlet 3.0 API can be resolved in Central -->
<groupId>org.jboss.spec.javax.servlet</groupId>
<artifactId>jboss-servlet-api_3.0_spec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<artifactId>seam-faces-api</artifactId>
<groupId>org.jboss.seam.faces</groupId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.seam.international</groupId>
<artifactId>seam-international</artifactId>
<version>${seam.i18n.version}</version>
</dependency>
</dependencies>
<dependency>
<artifactId>seam-faces-api</artifactId>
<groupId>org.jboss.seam.faces</groupId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<artifactId>seam-persistence-api</artifactId>
<groupId>org.jboss.seam.persistence</groupId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.seam.international</groupId>
<artifactId>seam-international</artifactId>
<version>${seam.i18n.version}</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>code-coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>emma-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.sonatype.maven.plugin</groupId>
<artifactId>emma4it-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<profiles>
<profile>
<id>code-coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>emma-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.sonatype.maven.plugin</groupId>
<artifactId>emma4it-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import javax.faces.event.PhaseListener;

import org.jboss.seam.faces.context.FlashScopedContext;
import org.jboss.seam.faces.transaction.TransactionPhaseListener;

/**
* Provide CDI injection to PhaseListener artifacts by delegating through this
Expand Down Expand Up @@ -79,7 +80,7 @@ private boolean shouldProcessPhase(final PhaseListener listener, final PhaseEven
@SuppressWarnings("unchecked")
private List<PhaseListener> getPhaseListeners()
{
return getListeners(FlashScopedContext.class, PhaseEventBridge.class);
return getListeners(FlashScopedContext.class, PhaseEventBridge.class, TransactionPhaseListener.class);
}

}
Loading

0 comments on commit 491e64c

Please sign in to comment.