[seam-commits] Seam SVN: r13138 - examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Jun 14 10:19:21 EDT 2010


Author: pete.muir at jboss.org
Date: 2010-06-14 10:19:21 -0400 (Mon, 14 Jun 2010)
New Revision: 13138

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/Confirmed.java
Log:
minor

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-14 14:14:29 UTC (rev 13137)
+++ examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgentBean.java	2010-06-14 14:19:21 UTC (rev 13138)
@@ -33,7 +33,6 @@
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.inject.Produces;
 import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.util.AnnotationLiteral;
 import javax.inject.Inject;
 import javax.inject.Named;
 import javax.persistence.EntityManager;
@@ -128,15 +127,11 @@
       }
    }
 
-   //@End
    public void confirm()
    {
       em.persist(booking);
       // FIXME can't inject event object into bean with passivating scope
-      // bookingConfirmedEvent.fire(new BookingEvent(booking));
-      manager.fireEvent(new BookingEvent(booking), new AnnotationLiteral<Confirmed>()
-      {
-      });
+      manager.fireEvent(new BookingEvent(booking), Confirmed.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();

Modified: examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/Confirmed.java
===================================================================
--- examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/Confirmed.java	2010-06-14 14:14:29 UTC (rev 13137)
+++ examples/trunk/booking-simplified/src/main/java/org/jboss/seam/examples/booking/booking/Confirmed.java	2010-06-14 14:19:21 UTC (rev 13138)
@@ -7,19 +7,27 @@
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 import java.lang.annotation.Documented;
-import java.lang.annotation.Inherited;
 import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
 
+import javax.enterprise.util.AnnotationLiteral;
 import javax.inject.Qualifier;
 
 /**
  * @author Dan Allen
  */
- at Target({TYPE, METHOD, PARAMETER, FIELD})
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
 @Retention(RUNTIME)
 @Documented
 @Qualifier
 public @interface Confirmed
 {
+
+   static class ConfirmedLiteral extends AnnotationLiteral<Confirmed> implements Confirmed
+   {
+      private static final long serialVersionUID = -7035985583479407806L;
+   }
+   
+   public static final Confirmed INSTANCE = new ConfirmedLiteral();
+
 }



More information about the seam-commits mailing list