12.07.2015 Views

Beginning Java EE 6 with GlassFish 3, Second Edition

Beginning Java EE 6 with GlassFish 3, Second Edition

Beginning Java EE 6 with GlassFish 3, Second Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

■ CONTENTSEJB Lite................................................................................................................................................. 189Reference Implementation ................................................................................................................... 189Putting It All Together ....................................................................................................190Writing the Book Entity......................................................................................................................... 191Writing the BookEJB Stateless Session Bean....................................................................................... 191Persistence Unit for the BookEJB......................................................................................................... 193Writing the Main Class.......................................................................................................................... 194Compiling and Packaging <strong>with</strong> Maven ................................................................................................. 194Deploying on <strong>GlassFish</strong>......................................................................................................................... 196Running the Main Class <strong>with</strong> the Application Client Container............................................................. 197Writing the BookEJBTest Class............................................................................................................. 197Summary .......................................................................................................................199■Chapter 7: Session Beans and the Timer Service................................................201Session Beans ...............................................................................................................201Stateless Beans.................................................................................................................................... 202Stateful Beans ...................................................................................................................................... 205Singletons............................................................................................................................................. 207Session Bean Model ............................................................................................................................. 214Asynchronous Calls .............................................................................................................................. 226Embeddable Usage............................................................................................................................... 228The Timer Service..........................................................................................................230Calendar-Based Expression.................................................................................................................. 231Automatic Timer Creation..................................................................................................................... 233Programmatic Timer Creation .............................................................................................................. 234Summary .......................................................................................................................235■Chapter 8: Callbacks and Interceptors ................................................................237Session Beans Life Cycle...............................................................................................237Stateless and Singleton........................................................................................................................ 237ix

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!