Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


 

Search Host

Monthly Fee($)
Disk Space (MB)
Register With us for Newsletter!
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
roseindia_net@yahoo.com
 
   

Tutorials

Java Server Pages

JAXB

Java Beans

JDBC

MySQL

Java Servlets

Struts

Bioinformatics

Java Code Examples

Interview Questions

 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Web Promotion

Web Submission

Submit Sites

Manual Submission?

Web Promotion Guide

Hosting Companies

Web Hosting Guide

Web Hosting

Linux

Beginner Guide to Linux Server

Frameworks

Persistence Framework

Web Frameworks

Free EAI Tools

Web Servers

Aspect Oriented Programming

Free Proxy Servers

Softwares

Adware & Spyware Remover

Open Source Softwares

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.

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).

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.

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

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.

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.

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.

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


RoseIndia.net
Join Our Java  News Group


Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum

About Us | Advertising On RoseIndia.net

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright 2004. All rights reserved.