Tuesday, January 16, 2007

SCBCD - EJB Overview

11)Identify correct programming restrictions that a Bean provider must follow to ensure that the enterprise bean is portable and can be deployed in any compliant EJB 2.0 Container. [Select all correct answers]

1)An enterprise bean must not use thread synchronization primitives to synchronize execution of multiple instances.
2)An enterprise bean must not use the java.io package to attempt to access files and directories in the file system.
3)An enterprise bean must not use the JMS API.
4)An enterprise bean must not use the java.util.zip package for reading and writing the standard ZIP.
5)An enterprise bean must not attempt to create a class loader

2)Which of the following are goals of the EJB 2.0 specification? [Select all correct answers]

1)Provide improved support for the persistence of entity beans.
2)Provide support for additional methods in the home interface.
3)Provide support for multi-threading of entity beans.
4)Provide a local client view and support for efficient, lightweight access to enterprise beans from local clients.
5)Provide support and reuse of socket channels.

3)Identify correct programming restrictions that a Bean provider must follow to ensure that the enterprise bean is portable and can be deployed in any compliant EJB 2.0 Container. [Select all correct answers]

1)The enterprise bean cannot define read and write to static fields.
2)The enterprise bean cannot make use of the Java Swing API.
3)The enterprise bean cannot make use of interfaces to define business methods.
4)The enterprise bean cannot make use of the Sun JavaMail API.
5)The enterprise bean must not attempt to define a class in a package.

4)At a certain development stage enterprise beans need to be assembled into a single deployment unit. Identify the correct role?

1)Enterprise Bean Provider.
2)Application Assembler.
3)EJB Container provider.
4)Deployer
5)System Administrator.

5)Identify all correct high-level requirements for the ejb-jar.xml file? [Select all correct answers]

1)The ejb-jar.xml must contain the enterprise bean class.
2)The ejb-jar.xml must contain the primary key class if the enterprise bean is a session bean.
3)The ejb-jar.xml must contain the J2SE classes that the enterprise bean depends on.
4)The ejb-jar.xml must contain the enterprise bean home and component interfaces.
5)The ejb-jar.xml must contain the stubs of the EJBHome and EJBObject interfaces

6)Who's responsibility is it to provide the structural information as given in the exhibit for each enterprise bean in the deployment descriptor?

<enterprise-beans>
<session id="ShoppingCart">
<ejb-name>ShoppingCart</ejb-name>
<local-home>com.baboon.ejb.ShoppingCartHome</local-home>
<local>com.baboon.ejb.ShoppingCart</local>
<ejb-class>com.baboon.ejb.ShoppingCartBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>


1)Application Assembler.
2)Bean provider.
3)EJB Container provider.
4)Deployer.
5)EJB Server provider.

7)Which of the following are overall goals of the EJB architecture? [Select all correct answers]

1)The EJB architecture will provide Message Driven Beans.
2)The EJB architecture will provide a standard component architecture for building distributed business applications.
3)The EJB architecture will provide a standard component architecture for building standalone business client applications.
4)The Enterprise JavaBeans architecture will be compatible with the CORBA protocols.
5)The Enterprise JavaBeans architecture will be compatible with the TCP/IP protocols.

8)What is the name of the role for the person who is a specialist in the area of distributed transaction management, distribute objects, and other lower-level system-level services?

1)EJB Server provider.
2)Application Assembler.
3)EJB Container provider.
4)Deployer.
5)System Administrator.

9)Which functionality is newly introduced in the EJB 2.0 specification? [Select all correct answers]

1)Message driven beans.
2)Remote client view.
3)Local client view.
4)Support for PL/SQL.
5)Enterprise Javabeans Query language.

10)Which of the following API's must the EJB 2.0 container make available to the enterprise bean instances at runtime? [Select all correct answers]

1)JNDI 1.2
2)Java 2 Platform, J2SE 1.4.
3)Java 2 Platform, J2SE 1.3
4)JMX 1.0
5)Hibernate 2.0.1

Answers:

1)1,2,4,5

Answers 1,2,4 and 5 are correct.

Answer 1 is correct. Synchronization would not work if the EJB Container distributed enterprise beans instances across multiple JVMs.

Answer 2 is correct. The file system APIs are not well-suited for business components to access data. Business components should use a resource manager API, such as JDBC, to store data.

Answer 4 is correct. The same reason applied as answer 2.

Answer 5 is correct. These functions are reserved for the EJB Container. Allowing the enterprise bean to use these functions could compromise security and decrease the Container's ability to properly manage the runtime environment.

Answer 3 is incorrect. The bean provider can make use of the JMS API.



2),2,4

Answers 1, 2 and 4 are correct.

The following are considered to be goals of the EJB 2.0 Specification:

  • Define the integration of EJB with the Java Message Service.
  • Provide a local client view and support for efficient, lightweight access to enterprise beans from local clients.
  • Provide improved support for the persistence of entity beans.
  • Provide improved support for the management of relationships among entity beans.
  • Provide a query syntax for entity bean finder methods.
  • Provide support for additional methods in the home interface.
  • Provide for network interoperability among EJB servers.


3)1,2,5

Answers 1, 2 and 5 are correct.

Answer 1 is correct. This rule is required to ensure consistent runtime semantics because while some EJB Containers may use a single JVM to execute all enterprise bean's instances, others may distribute the instances across multiple JVMs.

Answer 2 is correct. Most servers do not allow direct interaction between an application program and a keyboard/display attached to the server system.

Answer 5 is correct. This function is reserved for the EJB Container. Allowing the enterprise bean to perform this function would create a security hole.

Answer 3 is incorrect. It is possible to create an interface and implement the interface to make available in the enterprise bean business method.

Answer 4 is incorrect. The enterprise bean can make use of the JavaMail API.



4)2

Answer 2 is correct.

The following is a shortlist of the roles identified in the EJB 2.0 specification:

Enterprise Bean provider: The Enterprise Bean Provider is the producer of enterprise beans. His or her output is an ejb-jar file that contains one or more enterprise beans.

Application Assembler: The Application Assembler combines enterprise beans into larger deployable application units. The input to the Application Assembler is one or more ejb-jar files produced by the Bean Provider(s).

Deployer: The Deployer takes one or more ejb-jar files produced by a Bean Provider or Application Assembler and deploys the enterprise beans contained in the ejb-jar files in a specific operational environment.

EJB Server Provider: The EJB Server Provider is a specialist in the area of distributed transaction management, distribute objects, and other lower-level system-level services. A typical EJB Server Provider is an OS vendor, middleware vendor, or database vendor.

EJB Container Provider: The EJB Container Provider (Container Provider for short) provides: 1) The deployment tools necessary for the deployment of enterprise beans and 2) The runtime support for the deployed enterprise bean instances.

System Administrator: The System Administrator is responsible for the configuration and administration of the enterprise's computing and networking infrastructure that includes the EJB Server and Container.



5)1,4

Answers 1 and 4 are correct.

The following are high level requirements for the enterprise deployment descriptor: ejb-jar.xml

The ejb-jar file must contain, either by inclusion or by reference, the class files of each enterprise bean as follows:

  • The enterprise bean class.
  • The enterprise bean home and component interfaces.
  • The primary key class if the bean is an entity bean.
  • The ejb-jar file must also contain, either by inclusion or by reference, the class files for all the classes and interfaces that each enterprise bean class and the home and component interfaces depend on, except J2EE and J2SE classes.
  • The Application Assembler must not package the stubs of the EJBHome and EJBObject interfaces in the ejb-jar file.


6)2

Answer 2 is correct.

The following is a shortlist of the roles identified in the EJB 2.0 specification:

Enterprise Bean provider: The Enterprise Bean Provider is the producer of enterprise beans. His or her output is an ejb-jar file that contains one or more enterprise beans.

Application Assembler: The Application Assembler combines enterprise bean's into larger deployable application units. The input to the Application Assembler is one or more ejb-jar files produced by the Bean Provider(s).

Deployer: The Deployer takes one or more ejb-jar files produced by a Bean Provider or Application Assembler and deploys the enterprise bean's contained in the ejb-jar files in a specific operational environment.

EJB Server Provider: The EJB Server Provider is a specialist in the area of distributed transaction management, distribute objects, and other lower-level system-level services. A typical EJB Server Provider is an OS vendor, middleware vendor, or database vendor.

EJB Container Provider: The EJB Container Provider (Container Provider for short) provides: 1) The deployment tools necessary for the deployment of enterprise beans and 2) The runtime support for the deployed enterprise bean instances.

System Administrator: The System Administrator is responsible for the configuration and administration of the enterprise's computing and networking infrastructure that includes the EJB Server and Container.



7)2,4
Answers 2 and 4 are correct. Answer 1 is incorrect. The EJB 2.0 specification provided message driven beans, this is seen as a feature and not as a goal of the EJB architecture. Answer 3 is incorrect. The EJB architecture is focused on distributed applications and not on client applications. Answer 5 is incorrect.

8)1

Answer 1 is correct.

The following is a shortlist of the roles identified in the EJB 2.0 specification:

Enterprise Bean provider: The Enterprise Bean Provider is the producer of enterprise beans. His or her output is an ejb-jar file that contains one or more enterprise beans.

Application Assembler: The Application Assembler combines enterprise beans into larger deployable application units. The input to the Application Assembler is one or more ejb-jar files produced by the Bean Provider(s).

Deployer: The Deployer takes one or more ejb-jar files produced by a Bean Provider or Application Assembler and deploys the enterprise beans contained in the ejb-jar files in a specific operational environment.

EJB Server Provider: The EJB Server Provider is a specialist in the area of distributed transaction management, distribute objects, and other lower-level system-level services. A typical EJB Server Provider is an OS vendor, middleware vendor, or database vendor.

EJB Container Provider: The EJB Container Provider (Container Provider for short) provides:

  1. The deployment tools necessary for the deployment of enterprise beans
  2. The runtime support for the deployed enterprise bean instances.

System Administrator: The System Administrator is responsible for the configuration and administration of the enterprise's computing and networking infrastructure that includes the EJB Server and Container.



9)1,3,5

Answers 1, 3 and 5 are correct.

Message driven beans are introduced in the EJB 2.0 specification. A message-driven bean is a stateless component that is invoked by the container as a result of the arrival of a JMS message.

The local client view or local interfaces and local home interfaces for session beans and entity beans to provide support for lightweight access from enterprise beans that are local clients are part of the EJB 2.0 specification.

EJB-QL (Enterprise Javabeans Query language) this is a declarative syntax for the definition of query methods for entity beans with container-managed persistence that allows the implementation of finder and select methods to be provided by the container.

Answer 2 is incorrect, the remote client view was already part of the EJB 1.1 specification.

Answer 4 is incorrect, PL/SQL or stored procedures are not a direct requirement of the EJB specification.



10)1,3

Answers 1 and 3 are correct.

An EJB 2.0 Container must make these APIs available:

  • Java 2 Platform, Standard Edition v1.3 (J2SE) APIs
  • EJB 2.0 APIs
  • JNDI 1.2
  • JTA 1.0.1, the UserTransaction interface only
  • JDBC 2.0 extension
  • JMS 1.0.2
  • JavaMail 1.1, sending mail only
  • JAXP 1.0

These are only minimum requirements. The container may choose to provide additional functionality that is not required by the EJB specification.



No comments: