Exploring the session bean lifecycle
Imagine you’re a session bean. What matters to you? What are the key moments in your life? What do you need to know about the client? What do you need to know about the Container? What do you need to get from the Container?
Now imagine you’re the client. What’s your motivation? What do you need to know about how the Container works? And what if you’re the Container? What do you have to do to manage a bean’s life, and when do you have to do it?
If you’re the Bean Provider, what do you have to know about the bean’s lifecycle in order to write code that works? What if you want that code to be efficient?
In this chapter, we look at the entire world of a session bean, and we do it from different points of view. We take an OO approach to this chapter, iterating through deeper levels of detail. So don’t panic if the first several pages feel a little too high-level, or leave you with questions. You’ll be down in the dirt before the chapter’s done.
Before we start, let’s introduce the players:


Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access