310-090 Sun Certified Business Component Developer for J2EE Set 4

Which two statements about EJB roles and their security responsibilities are true? (Choose two.)

A. The System Administrator creates security roles for an EJB application.

B. The Application Assembler declares the principals used by the security roles.

C. The Deployer assigns principals to the security roles defined in an EJB application.

D. The Bean Provider defines the security role references used by an enterprise bean.


Options are :

  • C,D
  • B,C
  • A,D
  • A,B

Answer : C,D

310-090 Sun Certified Business Component Developer for J2EE Set 5

Given a deployment descriptor entry for a session bean:

6. <session>

10.

11. <ejb-name>BofSession</ejb-name>

12. <ejb-class>biz.session.BOFService</ejb-class>

13.

14. </session>

Which two are security-related elements that a Bean Provider can insert into the session bean's

entry on line 13? (Choose two.)

A. <security-role>

B. <security-role-ref>

C. <security-identity>

D. <method-permission>


Options are :

  • A,D
  • A,B
  • C,D
  • B,C

Answer : B,C

Which statement about primary key classes is false?


Options are :

  • The primary key class must have public get and set methods for all container-managed fields.
  • The primary key class must be serializable
  • The names of the fields in the primary key class must be a subset of the names of the container-managed fields
  • The primary key class must have a public constructor with no parameters

Answer : The primary key class must have public get and set methods for all container-managed fields.

Which two are guaranteed to a Bean Provider using an EJB 2.0 container? (Choose two.)

A. access to the JCE API

B. access to JavaMail API

C. access to the JXTA API

D. access to the JAXP API


Options are :

  • A,D
  • B,D
  • C,D
  • A,D

Answer : B,D

310-090 Sun Certified Business Component Developer for J2EE Set 6

Which is a valid equality comparison in EJB QL?


Options are :

  • comparing a cmp-field of type java.lang.String to an input parameter of type int
  • comparing entity objects of different abstract schema types that have the same primary key class
  • comparing a cmp-field of type java.lang.Float to an input parameter of type double
  • comparing a cmp-field of type java.lang.Boolean to a cmp-field of type java.lang.Integer

Answer : comparing a cmp-field of type java.lang.Float to an input parameter of type double

Which is a valid implementation of a message-driven bean's ejbCreate method?


Options are :

  • public void ejbCreate(javax.jms.Message message) {}
  • public javax.ejb.MessageDrivenBean ejbCreate() {}
  • NONE
  • public void ejbCreate() throws javax.ejb.CreateException {}
  • public void ejbCreate() { return; }

Answer : public void ejbCreate() { return; }

Which statement is true about the container provider's responsibilities regarding session beans?


Options are :

  • It is legal for the container to create a single instance of a stateless session bean and serialize all client invocations that arrive for that bean.
  • The container must support access to a session bean's local client view from an enterprise bean defined in a different enterprise archive (EAR).
  • If a session bean exposes both a local client view and a remote client view, the container must ensure that the names of the methods defined in the remote component interface and the local component interface are distinct
  • The container must support concurrent client invocations to a stateful session bean.

Answer : It is legal for the container to create a single instance of a stateless session bean and serialize all client invocations that arrive for that bean.

310-090 Sun Certified Business Component Developer for J2EE Set 7

Given an employee may have 0 or more dependents, and:

SELECT OBJECT (e)

FROM Employee e, IN (e.dependents) d

What is the result of the query?


Options are :

  • all employee's dependents
  • The EJB QL is syntactically incorrect
  • all employees with no dependents
  • all employees
  • all employees with at least one dependent
  • all employees and all their dependents

Answer : all employees with at least one dependent

Which is an EJB application exception?


Options are :

  • java.lang.RuntimeException
  • javax.ejb.ObjectNotFoundException
  • javax.ejb.EJBException
  • javax.ejb.NoSuchEntityException

Answer : javax.ejb.ObjectNotFoundException

Which statement about message-driven beans is true?


Options are :

  • When dispatching messages to message bean instances, the container must preserve the order in which messages arrive
  • If a message-driven bean is associated with a JMS durable subscription, each bean instance in the pool will receive each message sent to the durable subscription.
  • If a message-driven bean is associated with a JMS queue, each bean instance in the pool will receive each message sent to the queue
  • Each message-driven bean instance will be executed by at most one thread at a time

Answer : Each message-driven bean instance will be executed by at most one thread at a time

310-090 Sun Certified Business Component Developer for J2EE Set 8

Which method from javax.ejb.EJBContext returns an object that allows a Bean Provider to

demarcate transactions?


Options are :

  • begin()
  • getAutoCommit()
  • getTransaction()
  • beginTransaction()
  • getUserTransaction()

Answer : getUserTransaction()

Given:

10. public void addFoo(Foo theFoo)

11. {

12. fooList.add(theFoo);

13. }

Assume that Foo is a non-serializable class, and fooList is a valid java.util.Collection

implementation.

Which session bean interface is the most appropriate place to provide client access to the

method?


Options are :

  • the session bean local home interface
  • the session bean remote home interface
  • the session bean remote component interface
  • the session bean local component interface

Answer : the session bean local component interface

What role is responsible for implementing the java code for the finder methods for a CMP 2.0

entity bean?


Options are :

  • Container Provider
  • Bean Provider
  • Deployer
  • Application Assembler

Answer : Container Provider

310-090 Sun Certified Business Component Developer for J2EE Set 9

Under which two circumstances is the ejbRemove method called on a CMP entity bean? (Choose

two.)

A. when the idle timeout of the bean is reached

B. when the client has called the remove method

C. before the pooled bean instance is destroyed by the container

D. through the use of a cascade-delete specified in the deployment descriptor


Options are :

  • B,D
  • A.D
  • A,B
  • C,D

Answer : B,D

Given the following business method of a remotely called stateful session bean:

42. public void overPerform(){

43. // Code to perform business operation

44. }

Which exception can be thrown directly from the bean method?


Options are :

  • javax.ejb.ObjectNotFoundException
  • javax.ejb.RemoveException
  • javax.ejb.CreateException
  • javax.ejb.EJBException

Answer : javax.ejb.EJBException

Which statement is true about a session bean's component interface?


Options are :

  • A local client can use it to get a reference to the bean's remote home interface
  • A local client can invoke methods directly on the bean instance.
  • A local client must always handle or declare all method calls to the component interface
  • A local client cannot pass a reference to the component interface as an argument to another bean's remote interface.

Answer : A local client cannot pass a reference to the component interface as an argument to another bean's remote interface.

310-091 Sun Certified Bus. Component Developer Java EE Test Set 1

Which deployment descriptor entry correctly implements a cmr-field defined by the accessor

methods getName and setName for a CMP 2.0 entity bean?


Options are :

  • Name java.lang.String
  • name
  • name java.lang.String
  • Name
  • Name
  • name

Answer : name

Given the finder method:

java.util.Collection findCustomersByName(String name) throws javax.ejb.FinderException

Which is a valid EJB QL query?


Options are :

  • None
  • SELECT OBJECT(c) FROM Customer c WHERE c.name = ?1
  • SELECT c.name FROM Customer c WHERE c.name = ?1
  • SELECT o.customer.name FROM OrderBean o
  • ELECT o.customer FROM OrderBean o WHERE o.customer = ?1

Answer : SELECT OBJECT(c) FROM Customer c WHERE c.name = ?1

Which tag element would an Application Assembler use to associate an EJB reference to a target

enterprise bean in an <ejb-ref> tag?


Options are :

Answer :

310-091 Sun Certified Bus. Component Developer Java EE Test Set 10

Which statement about primary key classes is false?


Options are :

  • The primary key class must have public get and set methods for all container-managed fields.
  • The primary key class must be serializable
  • The primary key class must have a public constructor with no parameters
  • The names of the fields in the primary key class must be a subset of the names of the container-managed fields

Answer : The primary key class must have public get and set methods for all container-managed fields.

Which statement is true about the container's responsibilities regarding passivation/activation of

stateful session bean instances?


Options are :

  • If the instance contains an object reference to the java:comp/env JNDI context or its subcontext, the container must be able to save and restore it during passivation/activation.
  • The container is required to call ejbPassivate before removing a bean instance
  • The container is required to reset the value of the instance's transient fields during activation
  • The container is required to use Java Serialization to save the instance state during passivation.

Answer : If the instance contains an object reference to the java:comp/env JNDI context or its subcontext, the container must be able to save and restore it during passivation/activation.

Which two actions are appropriate if an enterprise bean's business method is remotely invoked by

a client? (Choose two.)

A. The container should propagate an application exception to the client.

B. The container should discard the bean instance for an application exception.

C. The client should handle the javax.ejb.EJBException, if thrown by the container.

D. The Bean Provider should propagate a java.lang.RuntimeException to the container.


Options are :

  • A,C
  • A,D
  • B,C
  • A,B

Answer : A,D

310-091 Sun Certified Bus. Component Developer Java EE Test Set 2

Given a session bean with a run-as identity, what is returned from getCallerPrincipal when

invoked from the bean's business method?


Options are :

  • the value of the security-role-ref associated with the method
  • the system principal under which the JVM running the enterprise bean executes
  • the run-as identity
  • the principal associated with the client invocation

Answer : the principal associated with the client invocation

QUESTION NO: 160

Given:

A bean calls setRollbackOnly on the EJBContext interface within a transactional business method.

Which two statements are true? (Choose two.)

A. The transaction timeout is immediately disabled.

B. The container will ensure that the transaction will never commit.

C. The bean must have started the current transaction for this to be legal.

D. The bean must have bean-managed transaction demarcation for this to be legal.

E. The bean must have container-managed transaction demarcation for this to be legal.


Options are :

  • C,E
  • B,E
  • D,E
  • A,E

Answer : B,E

Which is an Application Assembler's security-related responsibility?


Options are :

  • writing transactional programmatic security code
  • declaring the role-name element in the security-role-ref element in the deployment descriptor
  • declaring the security-role-ref element in the deployment descriptor
  • declaring the role-link element in the security-role-ref element in the deployment descriptor

Answer : declaring the role-link element in the security-role-ref element in the deployment descriptor

310-091 Sun Certified Bus. Component Developer Java EE Test Set 3

Which two statements about session beans are true? (Choose two.)

A. A session bean's constructor is allowed to perform resource manager access.

B. Both stateless and stateful beans are allowed to implement SessionSynchronization.

C. Client security information is not available to code within the setSessionContext method.

D. A UserTransaction interface is unavailable to session beans with container-managed

transactions.


Options are :

  • A,B
  • C,D
  • A,D
  • B,C

Answer : C,D

In which two scenarios will the container fail to call a stateful session bean's ejbRemove method

before removal? (Choose two.)

A. a crash of the EJB container

B. a timeout of client inactivity while the instance is in the active state

C. a timeout of client inactivity while the instance is in the passive state

D. The client makes a call to the remove method using bean-managed transaction demarcation.


Options are :

  • A,B
  • A,D
  • A,C
  • B,C

Answer : A,C

Which two transaction attributes are legal for the onMessage method of a message-driven bean?

(Choose two.)

A. Never

B. Supports

C. Required

D. Mandatory

E. NotSupported


Options are :

  • C,E
  • B,E
  • A,E
  • D,E

Answer : C,E

310-091 Sun Certified Bus. Component Developer Java EE Test Set 4

Which two methods must be implemented in a CMP entity bean? (Choose two.)

A. ejbCreate

B. ejbPassivate

C. unsetEntityContext

D. ejbFindByPrimaryKey


Options are :

  • A,B
  • C,D
  • B,C
  • A,D

Answer : B,C

Which two must be in an ejb-jar file, either by inclusion or reference? (Choose two.)

A. an enterprise archive (.ear) file

B. a deployment descriptor in the format defined by the EJB 2.0 specification

C. the class files for the classes that implement the home and remote interfaces

D. the class files for the interfaces and superinterfaces used by the bean, except J2SE or J2EE

interfaces

E. the class files for the stub classes of the EJBHome and EJBObject interfaces, if remote

interfaces are deployed for the bean


Options are :

  • A,B
  • B,E
  • B,D
  • B,C

Answer : B,D

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions