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

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


Options are :

  • declaring the role-name element in the security-role-ref element in the deployment descriptor
  • 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

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

Which is the correct XML fragment for defining a persistent field called accountNumber in a CMP

entity bean's deployment descriptor?


Options are :

  • accountNumber int
  • accountNumber
  • accountNumber
  • accountNumber java.lang.Integer

Answer : accountNumber

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

An enterprise bean calls the javax.naming.Context.rebind method to modify the value associated

with an environment entry. What is the expected behavior?


Options are :

  • The value is successfully modified but the new value is only available after server restart
  • The value is successfully modified and the new value is available to all instances of the enterprise bean
  • The value is successfully modified but the new value is only available to new instances of the enterprise bean
  • A javax.naming.OperationNotSupportedException is thrown.

Answer : A javax.naming.OperationNotSupportedException is thrown.

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 :

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

Answer : C,D

Which statement is true about the implementation of ejbSelect methods?


Options are :

  • The EJBObject contains wrapper methods which call the ejbSelect methods.
  • The Bean Provider supplies the implementation of the ejbSelect methods
  • The deployment descriptor's EJB QL guides the container's implementation.
  • The container calls the appropriate ejbFind methods in the bean class

Answer : The deployment descriptor's EJB QL guides the container's implementation.

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

Which statement is correct for an entity bean method with RequiresNew transaction attribute that

throws an application exception after invoking the setRollbackOnly method?


Options are :

  • The container rethrows the application exception without rolling back the transaction
  • The container rolls back the transaction and rethrows the application exception wrapped in an EJBException
  • The container rolls back the transaction, destroys the bean instance and rethrows the application exception.
  • The container rolls back the transaction and rethrows the application exception

Answer : The container rolls back the transaction and rethrows the application exception

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,C
  • B,D
  • A,D

Answer : A,C

Which method is required in a CMP entity bean's home interface?


Options are :

  • create
  • ejbCreate
  • findByPrimaryKey
  • setEntityContext

Answer : findByPrimaryKey

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

Which two items may be specified as part of an enterprise bean's environment? (Choose two.)

A. environment entries

B. the java.security.Principal

C. file resource manager connection factories

D. JavaMail resource manager connection factories


Options are :

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

Answer : A,D

Which statement is true about EJB security policy?


Options are :

  • It permits programmatic access to security context information in stateless session bean code
  • It mandates programmatic control of method access in entity bean code.
  • It mandates programmatic control of method access in stateful session bean code.
  • It executes message-driven bean methods using the message originator's security credentials

Answer : It permits programmatic access to security context information in stateless session bean code

Which describes an action that is most appropriate for an Application Assembler to perform?


Options are :

  • link an enterprise bean reference to a target enterprise bean
  • bind a resource manager connection factory reference to an actual resource factory
  • bind a UserTransaction interface for the enterprise beans that can use the interface
  • bind a resource environment reference to an actual resource

Answer : link an enterprise bean reference to a target enterprise bean

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

Which two are a Deployer's responsibility? (Choose two.)

A. declaring resource environment references for all administered objects

B. ensuring that the target enterprise beans are type-compatible with the types declared in EJB

references

C. checking that all declared EJB references are bound to the homes of enterprise beans in the

operational environment

D. assigning a proper value in the ejb-link element to target an enterprise bean as part of an EJB

reference configuration


Options are :

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

Answer : B,C

Which is a valid equality comparison in EJB QL?


Options are :

  • comparing a cmp-field of type java.lang.Boolean to a cmp-field of type java.lang.Integer
  • comparing a cmp-field of type java.lang.Float to an input parameter of type double
  • 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

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

Which two statements are true about an ejb-jar file? (Choose two.)

A. It must contain a WAR file.

B. The client does not need access to it.

C. It does not need to contain a deployment descriptor.

D. It must not contain application assembly information.

E. It must contain the bean class file by either inclusion or reference.

F. It must contain all classes generated by the container for this bean, by either inclusion or

reference.


Options are :

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

Answer : B,E

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

What are two reasons why the Application Assembler must understand the transactional behavior

associated with each transactional attribute? (Choose two.)

A. If not specified, a method's transaction attribute defaults to Required.

B. Some methods have restrictions as to what attributes are permissible.

C. A bean may be using both bean- and container-managed transaction demarcation.

D. The transactions must be scoped correctly for the application to work as designed.

E. The developer obtains the transaction attributes within the business method code, and they

must be set appropriately.


Options are :

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

Answer : B,D

Which exception must the caller of an ejbSelect method expect to handle?


Options are :

  • javax.ejb.DuplicateKeyException
  • java.rmi.RemoteException
  • javax.ejb.FinderException
  • javax.ejb.CreateException

Answer : javax.ejb.FinderException

You have a stateless session bean that requires access to the resource manager of a message

queue. What is the correct method in which to place the code that accesses the queue

connection?


Options are :

  • the ejbRemove method
  • the ejbCreate method
  • the setSessionContext method
  • a business method

Answer : a business method

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

Which two APIs are provided to the Bean Provider by an EJB 2.0 container? (Choose two.)

A. JTA

B. JMX

C. JSP

D. JDO

E. JAXP


Options are :

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

Answer : A,E

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


Options are :

  • A local client must always handle or declare all method calls to the component interface
  • A local client can invoke methods directly on the bean instance
  • A local client can use it to get a reference to the bean's remote home 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.

Which two methods cause a change in lifecycle state of a CMP entity bean? (Choose two.)

A. ejbLoad

B. ejbStore

C. ejbActivate

D. business methods

E. ejbFind<METHOD>

F. ejbHome<METHOD>

G. ejbCreate<METHOD>


Options are :

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

Answer : C,G

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

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

entity bean?


Options are :

  • Deployer
  • Application Assembler
  • ntainer Provider
  • Bean Provider

Answer : ntainer Provider

When will a container fail to invoke the ejbRemove() method?


Options are :

  • when the session bean throws an application exception back to the client that the client fails to handle correctly
  • when the client fails to invoke a method on a passivated session bean before the timeout period expires
  • when the client fails to invoke a method on an activated session bean before the timeout period expires
  • when the client invokes the remove() method after a transaction has rolled back

Answer : when the client fails to invoke a method on a passivated session bean before the timeout period expires

Which is a correct implementation of the ejbCreate method for a CMP 2.0 entity bean?


Options are :

  • public String ejbCreate(String custId, String name) throws CreateException { this.custId = custId; this.name = name; return null; }
  • public String ejbCreate(String custId, String name) throws CreateException { setCustId(custId); setName(name); return null; }
  • The container, not the developer, provides the implementation of ejbCreate.
  • public void ejbCreate(String custId, String name) throws CreateException { this.custId = custId; this.name = name; }

Answer : public String ejbCreate(String custId, String name) throws CreateException { setCustId(custId); setName(name); return null; }

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

Which two statements are true? (Choose two.)

A. A session bean must always have bean-managed transaction demarcation.

B. An entity bean must always have container-managed transaction demarcation.

C. If bean-managed transaction demarcation is chosen, the transactional attribute must be set.

D. A message-driven bean may utilize either container-managed or bean-managed transaction

demarcation.

E. A particular session bean may have both container-managed and bean-managed transaction

demarcation.


Options are :

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

Answer : B,D

Given the methods:

setSessionContext

ejbCreate

ejbRemove

afterBegin

Which two operations are allowed in ALL of the methods, given a stateful session bean with

container-managed transaction demarcation? (Choose two.)

A. access to an enterprise bean

B. JNDI access to environment entries

C. a call to SessionContext method getEJBHome

D. a call to SessionContext method isCallerInRole


Options are :

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

Answer : B,C

Which statement is true about stateless session beans?


Options are :

  • Stateless session bean instances must implement the javax.ejb.SessionSynchronization interface.
  • The bean class must not implement Serializable.
  • It is legal for stateless session beans to use bean-managed transactions
  • Stateless session bean instances store client-specific state across invocations

Answer : It is legal for stateless session beans to use bean-managed transactions

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

Which two interfaces must be implemented in a message-driven bean class, either directly or

indirectly? (Choose two.)

A. javax.jms.Session

B. java.util.EventListener

C. javax.jms.QueueReceiver

D. javax.jms.MessageListener

E. javax.ejb.MessageDrivenBean

F. javax.ejb.SessionSynchronization


Options are :

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

Answer : D,E

Which two events can transition a CMP 2.0 entity bean from the ready state to the pooled state?

(Choose two.)

A. The container invokes the ejbLoad method.

B. The container invokes the ejbRemove method.

C. The container invokes the ejbPassivate method.

D. The container invokes the unsetEntityContext method.


Options are :

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

Answer : B,C

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 component interface
  • the session bean local home interface
  • the session bean remote home interface
  • the session bean remote component interface

Answer : the session bean local component interface

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

Which statement is true about a session bean's lifecycle?


Options are :

  • Session beans cannot receive re-entrant loopback calls
  • The EJB 2.0 container can make concurrent calls to any stateful session bean instance.
  • A stateless session bean's home interface can have overloaded create methods.
  • Stateless session beans can implement javax.ejb.SessionSynchronization.

Answer : Session beans cannot receive re-entrant loopback calls

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions