Given a list of responsibilities, identify which belong to the deployer, bean provider, application assembler, container provider, system administrator, or any combination.

This page discusses - Given a list of responsibilities, identify which belong to the deployer, bean provider, application assembler, container provider, system administrator, or any combination.

Given a list of responsibilities, identify which belong to the deployer, bean provider, application assembler, container provider, system administrator, or any combination.

Given a list of responsibilities, identify which belong to the deployer, bean provider, application assembler, container provider, system administrator, or any combination.

Bean Provider's responsibility

The value of an environment entry is of the Java TYPE declared by the Bean Provider in the deployment descriptor.

The Bean Provider must DECLARE all the environment entries accessed from the enterprise bean's code. The environment entries are declared using the env-entry elements in the deployment descriptor.

If the Bean Provider provides a value for an environment entry using the env-entry-value element, the value CAN be changed later by the Application Assembler or Deployer.

The Bean Provider must use EJB REFERENCES to locate the home interfaces of other enterprise beans as follows:

  • Assign an entry in the enterprise bean's environment to the reference.

  • The EJB specification recommends, but does not require, that all references to other enterprise beans be organized in the ejb subcontext of the bean's environment (i.e., in the java:comp/env/ejb JNDI context).

  • Look up the home interface of the referenced enterprise bean in the enterprise bean's environment using JNDI.

The Bean Provider MUST DECLARE all the EJB REFERENCES using the ejb-ref and ejb-local-ref elements of the deployment descriptor. This allows the ejb-jar consumer (i.e. Application Assembler or Deployer) to discover all the EJB references used by the enterprise bean.

The Bean Provider must DECLARE all the RESOURCE MANAGER CONNECTION FACTORY REFERENCES in the deployment descriptor using the resource-ref elements. This allows the ejb-jar consumer (i.e. Application Assembler or Deployer) to discover all the resource manager connection factory references used by an enterprise bean.

The Bean Provider must use RESOURCE MANAGER CONNECTION FACTORY references to obtain connections to resources as follows:

  • Assign an entry in the enterprise bean's environment to the resource manager connection factory reference.

  • The EJB specification recommends, but does not require, that all RESOURCE MANAGER CONNECTION FACTORY REFERENCES be organized in the subcontexts of the bean's environment, using a different subcontext for each resource manager type. For example, all JDBC DataSource references might be declared in the java:comp/env/jdbc subcontext, and all JMS connection factories in the java:comp/env/jms subcontext. Also, all JavaMail connection factories might be declared in the java:comp/env/mail subcontext and all URL connection factories in the java:comp/env/url subcontext.

  • Lookup the resource manager connection factory object in the enterprise bean's environment using the JNDI interface.

  • Invoke the appropriate method on the resource manager connection factory to obtain a connection to the resource. The factory method is specific to the resource type. It is possible to obtain multiple connections by calling the factory object multiple times.

The Bean Provider can control the SHAREABILITY of the connections (element res-sharing-scope) acquired from the resource manager connection factory. By default, connections to a resource manager are SHAREABLE across other enterprise beans in the application that use the same resource in the same transaction context.

The Bean Provider has TWO choices with respect to dealing with associating a principal with the resource manager access:

  • Allow the Deployer to set up principal mapping or resource manager sign-on information. In this case, the enterprise bean code invokes a resource manager connection factory method that has NO security-related parameters.

  • Sign on to the resource manager from the bean CODE. In this case, the enterprise bean invokes the appropriate resource manager connection factory method that takes the sign-on information as method PARAMETERS.

The Bean Provider uses the res-auth deployment descriptor element to indicate which of the two resource manager authentication approaches is used.

The Bean Provider must use the javax.sql.DataSource resource manager connection factory type for obtaining JDBC connections, the javax.jms.QueueConnectionFactory or the javax.jms.TopicConnectionFactory for obtaining JMS connection, the javax.mail.Session resource manager connection factory type for obtaining JavaMail connections, and the java.net.URL resource manager connection factory type for obtaining URL connections.

The Bean Provider assigns an entry in the enterprise bean's environment to the reference. The EJB specification recommends, but does not require, that all RESOURCE ENVIRONMENT REFERENCES be organized in the appropriate subcontext of the bean's environment for the resource type (e.g. in the java:comp/env/jms JNDI context for JMS Destinations).

The Bean Provider must DECLARE all references to administered objects associated with resources using the resource-env-ref elements of the deployment descriptor. This allows the ejb-jar consumer to discover all the RESOURCE ENVIRONMENT REFERENCES used by the enterprise bean.

Application Assembler's responsibility

The Application Assembler is ALLOWED TO MODIFY the values of the environment entries set by the Bean Provider, and is ALLOWED TO SET the values of those environment entries for which the Bean Provider has not specified any initial values.

The Application Assembler can use the ejb-link element in the deployment descriptor to LINK an EJB reference to a target enterprise bean.

The Application Assembler SPECIFIES the LINK between two enterprise beans as follows:

  • The Application Assembler uses the optional ejb-link element of the ejb-ref or ejb-local-ref element of the referencing enterprise bean. The value of the ejb-link element is the name of the target enterprise bean. (It is the name defined in the ejb-name element of the target enterprise bean.) The target enterprise bean can be in any ejb-jar file in the same J2EE application as the referencing application component.

  • Alternatively, to avoid the need to rename enterprise beans to have unique names within an entire J2EE application, the Application Assembler may use the following syntax in the ejb-link element of the referencing application component. The Application Assembler specifies the path name of the ejb-jar file containing the referenced enterprise bean and appends the ejb-name of the target bean separated from the path name by '#' (../products/product.jar#ProductEJB). The path name is relative to the referencing application component jar file. In this manner, multiple beans with the same ejb-name may be uniquely identified when the Application Assembler cannot change ejb-names.

  • The Application Assembler must ensure that the target enterprise bean is type-compatible with the declared EJB reference. This means that the target enterprise bean must be of the type indicated in the ejb-ref-type element, and that the home and component interfaces of the target enterprise bean must be Java type-compatible with the interfaces declared in the EJB reference.

Deployer's responsibility

The Deployer must ENSURE that the values of all the environment entries declared by an enterprise bean are set to meaningful values.

The Deployer CAN MODIFY the values of the environment entries that have been previously set by the Bean Provider and/or Application Assembler, and must SET the values of those environment entries for which NO value has been specified.

The Deployer BINDS the EJB references to the enterprise bean homes in the target operational environment.

The Deployer must ENSURE that all the declared EJB references are bound to the homes of enterprise beans that exist in the operational environment. 0

The Deployer must ENSURE that the target enterprise bean is type-compatible with the types declared for the EJB reference. This means that the target enterprise bean must of the type indicated in the ejb-ref-type element, and that the home and component interfaces of the target enterprise bean must be Java type-compatible with the home and component interfaces declared in the EJB reference.

If an EJB reference declaration includes the ejb-link element, the Deployer should BIND the enterprise bean reference to the home of the enterprise bean specified as the link's target.

The Deployer BINDS the RESOURCE MANAGER CONNECTION FACTORY (i.e. Datasources) references to the actual resource manager connection factories that are configured in the Container (target operational environment). 1

The Deployer must perform the following tasks for each resource manager connection FACTORY REFERENCE declared in the deployment descriptor:

  • BIND the resource manager connection factory reference to a resource manager connection factory that exists in the operational environment. The resource manager connection factory type must be compatible with the type declared in the res-type element.

  • If the value of the res-auth element is Container, the Deployer is responsible for configuring the sign-on information for the resource manager. This is performed in a manner specific to the EJB Container and resource manager.

The Deployer BINDS the RESOURCE ENVIRONMENT REFERENCES to administered objects in the target operational environment. 2

The Deployer must ensure that all the declared resource environment references ARE BOUND to administered objects that exist in the operational environment.

The Deployer must ensure that the target object is type-compatible with the type declared for the resource environment reference. This means that the target object must be of the type indicated in the resource-env-ref-type element.

Container Provider's responsibility 3

The container provider has the following responsibilities:

  • Provide a deployment tool that allows the Deployer to set and modify the values of the enterprise bean's environment entries.

  • IMPLEMENT the java:comp/env environment naming context, and provide it to the enterprise bean instances at runtime. The naming context must include all the environment entries declared by the Bean Provider, with their values supplied in the deployment descriptor or set by the Deployer. The environment naming context must allow the Deployer to create subcontexts if they are needed by an enterprise bean.

  • The Container must ensure that the enterprise bean instances have only READ ACCESS to their environment variables. The Container must throw the javax.naming.OperationNotSupportedException from all the methods of the javax.naming.Context interface that modify the environment naming context and its subcontexts. 4

The Container Provider must provide the deployment tools which must be able to process the information supplied in the ejb-ref and ejb-local-ref elements in the deployment descriptor.

Provide the IMPLEMENTATION of the resource manager connection FACTORY CLASSES for the resource managers that are configured with the EJB Container.

If the Bean Provider sets the res-auth of a resource manager connection factory reference to Application, the Container must allow the bean to perform explicit programmatic sign-on using the resource manager's API. 5

The Container must provide tools that allow the Deployer to set up resource manager sign-on information for the resource manager references whose res-auth element is set to Container. The minimum requirement is that the Deployer must be able to specify the user/password information for each resource manager connection factory reference declared by the enterprise bean, and the Container must be able to use the user/password combination for user authentication when obtaining a connection to the resource by invoking the resource manager connection factory.

The Container MAY (not required) provide a mechanism to pool connections to the resources for the enterprise beans and otherwise manage the use of resources by the Container. The pooling must be transparent to the enterprise beans.

At the minimum, the deployment tools provided by the Container Provider must be able to inform the Deployer of any unresolved resource environment references, and allow him or her to resolve a resource environment reference by binding it to a specified compatible target object in the environment. 6

Visit http://java.boot.by  for the updates.

Tutorials

  1. Appendix A. First Appendix
  2. Second Section
  3. Third Section
  4. Part II. Appendixes
  5. From a list, identify the responsibility of the bean provider and the responsibility of the container provider for a message-driven bean.
  6. Chapter 6. Component Contract for Container-Managed Persistence (CMP)
  7. Identify correct and incorrect statements or examples about persistent relationships, remove protocols, and about the abstract schema type of a CMP entity bean.
  8. Identify the interfaces and methods a CMP entity bean must and must not implement.
  9. Match the name with a description of purpose or functionality, for each of the following deployment descriptor elements: ejb-name, abstract-schema-name, ejb-relation, ejb-relat
  10. Identify correctly-implemented deployment descriptor elements for a CMP bean (including container-managed relationships).
  11. From a list, identify the purpose, behavior, and responsibilities of the bean provider for a CMP entity bean, including but not limited to: setEntityContext, unsetEntityContext, ejbC
  12. Chapter 7. CMP Entity Bean Life Cycle
  13. Identify correct and incorrect statements or examples about the rules and semantics for relationship assignment and relationship updating in a CMP bean.
  14. From a list, identify the responsibility of the container for a CMP entity bean, including but not limited to: setEntityContext, unsetEntityContext, ejbCreate, ejbPostCreate, ejbActi
  15. Given a code listing, determine whether it is a legal and appropriate way to programmatically access a caller's security context.
  16. Chapter 10. Message-Driven Bean Component Contract
  17. Identify correct and incorrect statements about the purpose and use of the deployment descriptor elements for environment entries, EJB references, and resource manager connection factory r
  18. Identify the use and the behavior of the ejbPassivate method in a session bean, including the responsibilities of both the container and the bean provider.
  19. Chapter 12. Exceptions
  20. Identify correct and incorrect statements or examples about the client view of an entity bean's local component interface (EJBLocalObject).
  21. Identify EJB 2.0 container requirements.
  22. Chapter 1. EJB Overview
  23. Identify correct and incorrect statements or examples about EJB programming restrictions.
  24. Chapter 9. EJB-QL
  25. Identify correct and incorrect statements or examples about the purpose and use of EJB QL.
  26. Identify correct and incorrect conditional expressions, BETWEEN expressions, IN expressions, LIKE expressions, and comparison expressions.
  27. Identify correct and incorrect statements or examples about the client view of a entity bean's remote component interface (EJBObject).
  28. Given a list, identify which are requirements for an EJB-jar file.
  29. Match EJB roles with the corresponding description of the role's responsibilities, where the description may include deployment descriptor information.
  30. Chapter 2. Client View of a Session Bean
  31. Chapter 13. Enterprise Bean Environment
  32. Chapter 8. Entity Beans
  33. Identify the use, syntax, and behavior of, the following entity bean home method types, for Container-Managed Persistence (CMP); finder methods, create methods, remove methods, and home me
  34. Identify correct and incorrect statements or examples about an entity bean's primary key and object identity.
  35. Identify correct and incorrect statements or examples about the client's view of exceptions received from an enterprise bean invocation.
  36. Identify correct and incorrect statements or examples about application exceptions and system exceptions in entity beans, session beans, and message-driven beans.
  37. Given a particular method condition, identify the following: whether an exception will be thrown, the type of exception thrown, the container's action, and the client's view.
  38. Given a list of responsibilities related to exceptions, identify those which are the bean provider's, and those which are the responsibility of the container provider. Be prepared to recog
  39. SCBCD Study Guide
  40. Identify the use and behavior of the MessageDrivenContext interface methods.