[seam-commits] Seam SVN: r8461 - in trunk/examples/seampay: src/org/jboss/seam/example/seampay and 1 other directory.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Mon Jul 14 12:22:18 EDT 2008
Author: norman.richards at jboss.com
Date: 2008-07-14 12:22:17 -0400 (Mon, 14 Jul 2008)
New Revision: 8461
Added:
trunk/examples/seampay/src/org/jboss/seam/example/seampay/PaymentHome.java
Removed:
trunk/examples/seampay/src/org/jboss/seam/example/seampay/PaymentController.java
Modified:
trunk/examples/seampay/resources/WEB-INF/components.xml
Log:
JBSEAM-3162
Modified: trunk/examples/seampay/resources/WEB-INF/components.xml
===================================================================
--- trunk/examples/seampay/resources/WEB-INF/components.xml 2008-07-14 14:53:03 UTC (rev 8460)
+++ trunk/examples/seampay/resources/WEB-INF/components.xml 2008-07-14 16:22:17 UTC (rev 8461)
@@ -11,9 +11,10 @@
http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.1.xsd" >
<pay:payment-home
- new-instance="#{newPayment}"
+ new-instance="#{newPayment}"
created-message="Created a new payment to #{newPayment.payee}" />
+
<pay:payment name="newPayment"
payee="Somebody"
account="#{selectedAccount}"
@@ -32,13 +33,13 @@
order="accountNumber"
max-results="20"
entity-manager="#{entityManager}" />
-
+
<persistence:managed-persistence-context name="entityManager"
auto-create="true"
persistence-unit-jndi-name="java:/seampayEntityManagerFactory" />
<async:timer-service-dispatcher />
- <component class="org.jboss.seam.async.ThreadPoolDispatcher" precedence="40" /> <!-- TEST -->
+ <component class="org.jboss.seam.async.ThreadPoolDispatcher" precedence="40" />
<core:init debug="true" jndi-pattern="@jndiPattern@" />
Deleted: trunk/examples/seampay/src/org/jboss/seam/example/seampay/PaymentController.java
===================================================================
--- trunk/examples/seampay/src/org/jboss/seam/example/seampay/PaymentController.java 2008-07-14 14:53:03 UTC (rev 8460)
+++ trunk/examples/seampay/src/org/jboss/seam/example/seampay/PaymentController.java 2008-07-14 16:22:17 UTC (rev 8461)
@@ -1,65 +0,0 @@
-package org.jboss.seam.example.seampay;
-
-import javax.ejb.NoSuchObjectLocalException;
-import javax.ejb.Timer;
-import javax.ejb.TimerHandle;
-
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.web.RequestParameter;
-import org.jboss.seam.annotations.Transactional;
-import org.jboss.seam.faces.FacesMessages;
-import org.jboss.seam.framework.EntityHome;
-import org.jboss.seam.log.Log;
-
- at Name("paymentHome")
-public class PaymentController
- extends EntityHome<Payment>
-{
- private static final long serialVersionUID = -1994187524284737182L;
-
- @RequestParameter Long paymentId;
- @In PaymentProcessor processor;
-
- @Logger Log log;
-
- public String saveAndSchedule()
- {
- String result = persist();
-
- Payment payment = getInstance();
- log.info("scheduling instance #0", payment);
-
- Timer timer = processor.schedulePayment(payment.getPaymentDate(),
- payment.getPaymentFrequency().getInterval(),
- payment);
- if (timer != null) {
- payment.setTimerHandle(timer.getHandle());
- }
- return result;
- }
-
- @Override
- public Object getId() {
- return paymentId;
- }
-
- @Transactional
- public void cancel() {
- Payment payment = getInstance();
-
- TimerHandle handle = payment.getTimerHandle();
- payment.setTimerHandle(null);
- payment.setActive(false);
-
- if (handle != null) {
- try {
- handle.getTimer().cancel();
- } catch (NoSuchObjectLocalException e) {
- FacesMessages.instance().add("Payment already processed");
- }
- }
- }
-
-}
Added: trunk/examples/seampay/src/org/jboss/seam/example/seampay/PaymentHome.java
===================================================================
--- trunk/examples/seampay/src/org/jboss/seam/example/seampay/PaymentHome.java (rev 0)
+++ trunk/examples/seampay/src/org/jboss/seam/example/seampay/PaymentHome.java 2008-07-14 16:22:17 UTC (rev 8461)
@@ -0,0 +1,65 @@
+package org.jboss.seam.example.seampay;
+
+import javax.ejb.NoSuchObjectLocalException;
+import javax.ejb.Timer;
+import javax.ejb.TimerHandle;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.web.RequestParameter;
+import org.jboss.seam.annotations.Transactional;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.framework.EntityHome;
+import org.jboss.seam.log.Log;
+
+ at Name("paymentHome")
+public class PaymentHome
+ extends EntityHome<Payment>
+{
+ private static final long serialVersionUID = -1994187524284737182L;
+
+ @RequestParameter Long paymentId;
+ @In PaymentProcessor processor;
+
+ @Logger Log log;
+
+ public String saveAndSchedule()
+ {
+ String result = persist();
+
+ Payment payment = getInstance();
+ log.info("scheduling instance #0", payment);
+
+ Timer timer = processor.schedulePayment(payment.getPaymentDate(),
+ payment.getPaymentFrequency().getInterval(),
+ payment);
+ if (timer != null) {
+ payment.setTimerHandle(timer.getHandle());
+ }
+ return result;
+ }
+
+ @Override
+ public Object getId() {
+ return paymentId;
+ }
+
+ @Transactional
+ public void cancel() {
+ Payment payment = getInstance();
+
+ TimerHandle handle = payment.getTimerHandle();
+ payment.setTimerHandle(null);
+ payment.setActive(false);
+
+ if (handle != null) {
+ try {
+ handle.getTimer().cancel();
+ } catch (NoSuchObjectLocalException e) {
+ FacesMessages.instance().add("Payment already processed");
+ }
+ }
+ }
+
+}
More information about the seam-commits
mailing list