Listing Letting ejbPostCreate create a Timer

public class UserBean {

private EntityContext ctx;

public void setEntityContext(EntityContext ctx) { this.ctx = ctx;

public void ejbPostCreate(String username, String password) { ctx.getTimerService().createTimer(

BunchOfConstants.TWO_MONTHS, "password expired");

We know the UserBean class should be abstract, implement the javax.ejb.Enti-tyBean interface, and so forth, in order to be a valid entity bean implementation, according to the EJB 2.1 specification. Consider writing some contract tests for checking such things for our entity beans. Leaving that thought behind for a while, we set out to tackle the other half of creating a timer—the stuff that happens when the timer goes off.

+1 0

Average user rating: 5 stars out of 1 votes

Post a comment

  • Receive news updates via email from this site