2.3.1. EJB Architecture

Containers.  Environment providing services to enterprise application objects

Enterprise Beans.  Enterprise application objects managed by container

Stateful session bean

an object that lives within user session scope, state survives method invocation

Stateless session bean

an object that lives within user session scope, state only within method invocation

Singleton session bean

a singleton application object

Entity bean

an object representing persistent database state

Message driven bean

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);
    ...
}
@Dependent

instance bound to single injection point

@RequestScoped

context associated with single method invocation or request handling

@SessionScoped

context associated with an HTTP session

@ApplicationScoped

context associated with application execution

@ConversationScoped

context associated with explicitly delimited UI interaction