Term
|
Definition
server-side components, called enterprise beans, are distributed objects that are hosted in Enterprise JavaBean containers and provide remote services for clients distributed throughout the network. |
|
|
Term
What does Enterprise JavaBeans specification define ? |
|
Definition
defines an architecture for a transactional, distributed object system based on components. The specification mandates a programming model |
|
|
Term
What are responsibilities of EJB Container ? |
|
Definition
remote access to the bean, security, persistence, transactions, concurrency, and access to and pooling of resources. |
|
|
Term
Can the bean be directly called by outside clients ? |
|
Definition
remote access to the bean, security, persistence, transactions, concurrency, and access to and pooling of resources. |
|
|
Term
Can the bean be directly called by outside clients ? |
|
Definition
No, the container first intercepts the invocation to ensure persistence, transactions, and security are applied properly to every operation a client performs on the bean. |
|
|
Term
Can more than one bean be run in a Container ? |
|
Definition
Yes, Containers will manage many beans simultaneously in the same fashion that the Java WebServer manages many servlets. |
|
|
Term
How can container optimize bean usage ? |
|
Definition
1. To reduce memory consumption and processing, containers pool resources and manage the lifecycles of all the beans very carefully.
2. When a bean is not being used, a container will place it in a pool to be reused by another client, or possibly evict it from memory and only bring it back when its needed.
|
|
|
Term
What will happen if client uses reference of evicted bean ? |
|
Definition
When the client invokes a method on the remote reference, the container simply re-incarnates the bean to service the request. The client application is unaware of the entire process. |
|
|
Term
How does the EJB interact with the container ? |
|
Definition
The enterprise bean interacts with its container through one of three mechanisms: callback methods, the EJBContext interface, or the Java Naming and Directory Interface (JNDI). |
|
|
Term
How does container use Call back methods to talk to the bean? |
|
Definition
Every bean implements a subtype of the EnterpriseBean interface which defines several methods, called callback methods. Each callback method alerts the bean TO a different event in its lifecycle and the container will invoke these methods to notify the bean when it's about to activate the bean, persist its state to the database, end a transaction, remove the bean from memory, etc |
|
|
Term
|
Definition
EJBContext object, is a reference directly to the container.
The EJBContext interface provides methods for interacting with the container so that that bean can request information about its environment like the identity of its client, the status of a transaction, or to obtain remote references to itself. |
|
|
Term
|
Definition
Java Naming and Directory Interface (JNDI) |
|
|
Term
|
Definition
(JNDI) is a standard extension to the Java platform for accessing naming systems like LDAP, NetWare, file systems, etc |
|
|
Term
What is a beans Environment Naming Context? |
|
Definition
a special naming system, The ENC is managed by the container and accessed by beans using JNDI. The JNDI ENC allows a bean to access resources like JDBC connections, other enterprise beans, and properties specific to that bean. |
|
|
Term
What does the EJB Specification define? |
|
Definition
defines a bean-container contract, which includes the mechanisms (callbacks, EJBContext, JNDI ENC) described above as well as a strict set of rules that describe how enterprise beans and their containers will behave at runtime, how security access is checked, how transactions are managed, how persistence is applied, etc. |
|
|
Term
What are the advantages of bean-container contract? |
|
Definition
The bean-container contract is designed to make enterprise beans portable between EJB containers so that enterprise beans can be developed once then run in any EJB container. |
|
|
Term
In addition to portablility of business logic what other advantage is there of usign EJB model? |
|
Definition
e simplicity of the EJB programming model makes EJB valuable. Because the container takes care of managing complex tasks like security, transactions, persistence, concurrency and resource management, the bean developer is free to focus attention on business rules and a very simple programming model. |
|
|
Term
How is an EJB class accessed by the client ? |
|
Definition
Enterprise beans live in an EJB container and are accessed by client applications over the network through their remote and home interfaces. |
|
|
Term
What does the home interface provide? |
|
Definition
The home interface represents the life-cycle methods of the component (create, destroy, find). |
|
|
Term
What is does the remote interface represent? |
|
Definition
Remote Interface represents the business method of the bean. |
|
|
Term
|
Definition
The EJBObject interface is extended by all enterprise Bean's remote interface. An enterprise Bean's remote interface provides the client's view of an EJB object. An enterprise Bean's remote interface defines the business methods callable by a client. |
|
|