Containers. Environment providing services to enterprise application objects
Lifecycle management (creating and deleting instances)
Dependency management (resource and dependency injection)
Persistence and transactions
...
Enterprise Beans. Enterprise application objects managed by container
an object that lives within user session scope, state survives method invocation
an object that lives within user session scope, state only within method invocation
a singleton application object
an object representing persistent database state
an object that handles messages, state only within message handling
Scopes and Contexts.
public interface Context { public Class <? extends Annotation> getScope (); public <T> T get (Contextual <T> bean); public <T> T get (Contextual <T> bean, CreationalContext <T> creationalContext); ... }
instance bound to single injection point
context associated with single method invocation or request handling
context associated with an HTTP session
context associated with application execution
context associated with explicitly delimited UI interaction