[seam-commits] Seam SVN: r13165 - in examples/trunk/booking-simplified/src/main: webapp/WEB-INF and 1 other directory.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Tue Jun 15 16:48:34 EDT 2010
Author: dan.j.allen
Date: 2010-06-15 16:48:34 -0400 (Tue, 15 Jun 2010)
New Revision: 13165
Modified:
examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java
examples/trunk/booking-simplified/src/main/webapp/WEB-INF/beans.xml
Log:
use @Begin and @End
Modified: examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java
===================================================================
--- examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java 2010-06-15 20:28:04 UTC (rev 13164)
+++ examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java 2010-06-15 20:48:34 UTC (rev 13165)
@@ -28,7 +28,6 @@
import java.util.Calendar;
import javax.ejb.Stateful;
-import javax.enterprise.context.Conversation;
import javax.enterprise.context.ConversationScoped;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
@@ -43,6 +42,8 @@
import org.jboss.seam.examples.booking.model.Booking;
import org.jboss.seam.examples.booking.model.Hotel;
import org.jboss.seam.examples.booking.model.User;
+import org.jboss.seam.faces.context.conversation.Begin;
+import org.jboss.seam.faces.context.conversation.End;
import org.jboss.seam.international.status.MessageFactory;
import org.jboss.seam.international.status.Messages;
import org.jboss.seam.international.status.builder.BundleKey;
@@ -59,8 +60,8 @@
@PersistenceContext(type = EXTENDED)
private EntityManager em;
- @Inject
- private Conversation conversation;
+// @Inject
+// private Conversation conversation;
@Inject
private MessageFactory mf;
@@ -85,14 +86,14 @@
private boolean bookingValid;
- //@Begin
+ @Begin
public void selectHotel(final Hotel hotel)
{
// NOTE get a fresh reference that's managed by the conversational
// persistence context
hotelSelection = em.find(Hotel.class, hotel.getId());
log.info(mf.info("Selected the {0} in {1}").textParams(hotelSelection.getName(), hotelSelection.getCity()).build().getText());
- conversation.begin();
+ //conversation.begin();
}
public void bookHotel()
@@ -127,6 +128,7 @@
}
}
+ @End
public void confirm()
{
em.persist(booking);
@@ -134,15 +136,15 @@
manager.fireEvent(new BookingEvent(booking), ConfirmedLiteral.INSTANCE);
log.info(mf.info("New booking at the {0} confirmed for {1}").textParams(booking.getHotel().getName(), booking.getUser().getName()).build().getText());
messages.info(new BundleKey("messages.properties", "booking.confirmed")).textDefault("Booking confirmed.");
- conversation.end();
+ //conversation.end();
}
- //@End
+ @End
public void cancel()
{
booking = null;
hotelSelection = null;
- conversation.end();
+ //conversation.end();
}
@Produces
Modified: examples/trunk/booking-simplified/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- examples/trunk/booking-simplified/src/main/webapp/WEB-INF/beans.xml 2010-06-15 20:28:04 UTC (rev 13164)
+++ examples/trunk/booking-simplified/src/main/webapp/WEB-INF/beans.xml 2010-06-15 20:48:34 UTC (rev 13165)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+ <interceptors>
+ <class>org.jboss.seam.faces.context.conversation.ConversationBoundaryInterceptor</class>
+ </interceptors>
+</beans>
\ No newline at end of file
More information about the seam-commits
mailing list