[jboss-user] [JBoss Seam] - Re: Qestion about timers in jboss seam
vadger
do-not-reply at jboss.com
Tue Aug 14 08:45:12 EDT 2007
Am I right, if I have for instance:
| @Stateful
| @Name("paymentAction")
| public class CreatePaymentAction
| {
| @In(create=true) PaymentHandler paymentHandler;
| @In Bill bill;
|
| public String schedulePayment()
| {
| paymentHandler.processScheduledPayment( new Payment(bill), bill.getDueDate() );
| return "success";
| }
|
| public String scheduleRecurringPayment()
| {
| paymentHandler.processRecurringPayment( new Payment(bill), bill.getDueDate(),
| ONE_MONTH );
| return "success";
| }
| }
The example is taken from seam documentation.
So, if I want to invoke method at deploy time, I have to do next:
| @Stateful
| @Name("paymentAction")
| public class CreatePaymentAction
| {
| @In(create=true) PaymentHandler paymentHandler;
| @In Bill bill;
|
| public String schedulePayment()
| {
| paymentHandler.processScheduledPayment( new Payment(bill), bill.getDueDate() );
| return "success";
| }
|
| @Observer("org.jboss.seam.postInitialization")
| public String scheduleRecurringPayment()
| {
| paymentHandler.processRecurringPayment( new Payment(bill), bill.getDueDate(),
| ONE_MONTH );
| return "success";
| }
| }
?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073981#4073981
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073981
More information about the jboss-user
mailing list