-
1. Re: Asynchronous not working on POJO
michel.ing Aug 20, 2010 12:47 AM (in response to agmkam)Be sure that the method that you excute with @Asyncronous is in another class that is injected where the method is called x ej :
@Name(
emailService
)
@AutoCreate
public class EmailService {@In
private Renderer renderer;
@Asynchronous
public void sendMessageUser(@Duration long delay, String template,
User user, String str) {
try {
Contexts.getEventContext().set(info
, user);
Contexts.getEventContext().set(myPassword
, str);
renderer.render(template);
} catch (Exception e) {
e.printStackTrace();
}
}this is called from another class:
loggerAsync.saveLogBook(new Date(),
UtilDate.cronFormat(cal1.getTime()), cal2.getTime(), bit,
identity.getCredentials().getUsername());
}
and works :)