Week 2 - Container services Flashcards
What are some container services?
- Dependency Injection
- Concurrency
- Security
- Transactions
- Instance pooling
- Lifecycle callbacks
- Interceptors
- Persistence
- Timers
- Naming and Object Stores
- Interoperability
Stateless and stateful session beans support concurrent access (T or F)
F
Message drive beans handle one message at a time (T or F)
T
Persistence/Entity beans may be accessed concurrently (T or F)
T
Clients never access EJBs directly (T or F)
T
What are naming and object stores?
Java Naming and Directory Interface (JNDI) used for naming services so that the client can look it up.
(An abstraction for service access)
what is Interoperability?
Interoperability refers to the ability of different systems, technologies, or applications to work together and exchange data or services effectively. It allows different software and hardware components, often from different vendors or platforms, to communicate and function together seamlessly.
Describe the activation mechanism used by containers.
Stateful session beans maintain client state.
Client state can be passivated or activated by the server to manage memory.
Passivation is like a temporary deletion that can be recovered.
What is a lifecycle callback?
Annotated methods that trigger with lifecycle events
@jakarta.ejb.PrePassivate
@jakarta.ejb.PostActivate
What is an interceptor?
Factor out common code required over several methods.
Modifies behavior before or after method called (intercept)
What are two ways to configure/utilize a container?
Annotations, XML descriptors.
What are local or remote session beans
Client running in same JVM (local INTERFACE)
@jakarta.ejb.Local
Client running in different JVM (remote INTERFACE)
@jakarta.ejb.Remote
Recall timesheet app, interface for client to interact with session information.
@Local(CalculatorLocalBusiness.class) -> defines interface for session bean
@LocalBean -> no interface for session bean