O'Reilly logo

Java EE 7 with GlassFish 4 Application Server by David R. Heffelfinger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enterprise JavaBean life cycles

Enterprise JavaBeans go through different states in their life cycle. Each type of EJB has different states. States specific to each type of EJB are discussed in the next sections.

The stateful session bean life cycle

Readers with experience in previous versions of J2EE may remember that in previous versions of the specification, session beans were required to implement the javax.ejb.SessionBean interface. This interface provided methods to be executed at certain points in the session bean's life cycle. Methods provided by the SessionBean interface include:

  • ejbActivate()
  • ejbPassivate()
  • ejbRemove()
  • setSessionContext(SessionContext ctx)

The first three methods were meant to be executed at certain points in the bean's life ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required