Black Friday Sale Special - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: sntaclus

You work as a Software Developer for NewTech Inc. You write a bean class using Enterprise

JavaBeans 3.0. The class uses the @DeclareRoles ("ADMIN, HR, DBA, USER") annotation to declare the security roles. The class contains a method named showResult(). You want to ensure that the ADMIN role is granted privilege to the showResult() method. Moreover, if a role that is not allowed to access the method tries to call the method, an error message must be shown. Assuming that there is no security-related element in the deployment descriptor, which of the following will you use to accomplish the task?

Each correct answer represents a part of the solution. Choose two.

A.

The isCallerInRole() method

B.

The getCallerPrincipal() method

C.

The @RolesAllowed("ADMIN") annotation

D.

The @PermitAll annotation

Which of the following statements are true?

Each correct answer represents a complete solution. Choose all that apply.

A.

An inner class cannot be defined as private.

B.

An inner class cannot be defined as protected.

C.

An inner class can be defined as private.

D.

An inner class can extend another class.

Which of the following methods of the EJBContext interface can be called by both the BMT and CMT beans?

Each correct answer represents a complete solution. Choose all that apply.

A.

getCallerPrincipal()

B.

getRollbackOnly()

C.

getUserTransaction()

D.

isCallerInRole()

Which of the following are valid thread state transitions?

Each correct answer represents a complete solution. Choose all that apply.

A.

From running to ready.

B.

From ready to waiting.

C.

From running to waiting.

D.

From waiting to ready.

E.

From ready to running.

F.

From waiting to running.

Which of the following statements are true about object serialization?

Each correct answer represents a complete solution. Choose all that apply.

A.

After deserialization, objects have the same state as it had when it was serialized.

B.

It uses ObjectOutputStream to deserialize objects.

C.

It uses the ObjectInput and ObjectOutput interfaces.

D.

An object will have the same state at deserialization as it had at the time it was serialized if all its superclasses are also serializable.

Which of the following methods can be invoked from the ejbStore() method of an entity bean class?

Each correct answer represents a complete solution. Choose all that apply.

A.

getPrimaryKey()

B.

getUserTransaction()

C.

getRollbackOnly()

D.

isCallerInRole()

E.

getEJBObject()

Which of the following data type values is returned by the System.in.read() console input function?

A.

String

B.

Character

C.

Float

D.

Integer

Which of the following exceptions will be thrown by the getFeature() method if the feature value cannot be assigned or retrieved?

A.

SAXNotSupportedException

B.

SAXNotRecognizedException

C.

NullPointerException

D.

IllegalArgumentException

Which of the following security related elements of the deployment descriptor matches the argument to the isCallerInRole() method?

A.

B.

C.

D.

The __________ interface accepts results from a SQL SELECT statement.

A.

Connection

B.

ResultSet

C.

PreparedStatement

D.

DatabaseMetaData