web analytics

Latest Update Real PassLeader 1Z0-895 Exam Brian Dumps For Free Download

Vendor: Oracle
Exam Code: 1Z0-895
Exam Name: Java EE 6 Enterprise JavaBeans Developer Certified Expert Exam

QUESTION 1
You are writing a client that sends a message to a JMS queue. What two statements are true?

A.    You cannot use resource injection to access a JMS destination from a Java EE application client.
B.    You can use resource injection to access a JMS destination from a servlet.
C.    You must use a JNDI lookup to access a JMS destination from a standalone Java class.
D.    You cannot use a JNDI lookup to access a JMS destination from a session bean.

Answer: BC

QUESTION 2
You are writing a client that sends a message to a JMS queue. The client includes the following code snippet:
21

A.    The message can be consumed by durable subscriber.
B.    In the first line, the argument to the createProducer method needs to be cast to a Destination.
C.    The message is sent using non-default deliver mode, priority, and expiration time values.
D.    You could add more name-value pairs to the message body of the MapMessage if they were required
by your application.

Answer: D

QUESTION 3
Given the following stateless session bean implementation classes:
31
Assuming no other transaction-related metadata, what are the transaction attributes of methodA, methodB, and methodC respectively?

A.    MANDATORY, MANDATORY , and MANDATORY
B.    REQUIRED, MANDATORY, and REQUIRES_NEW
C.    MANDATORY, MANDATORY , and REQUIRES_NEW
D.    REQUIRED, REQUIRES_NEW, and REQUIRES_NEW

Answer: C

QUESTION 4
Which API must an EJB 3.1 container make available to enterprise beans at runtime? (Choose one)

A.    The JXTA 1.1 API
B.    The MIDP 2.0 API
C.    The Java SE 6 JNDI API
D.    The Java SE 5 JDBC API

Answer: CD

QUESTION 5
A developer wants to write a stateful session bean using the following interface as local business interface:
1. package acme;
2. public interface Bar {
3. public void bar ();
4. }
Assuming there is not an ejb-jar.xml file, which code can be inserted into Lines 4-6 below to define the bean with the ejb name of BarBean?
1. package acme;
2. import javax.ejb.*;
3. import java.io.*;
4.
5.
6.
7. }

A.    @Stateful
public class BarEJB implements Bar {
public void bar () {}
B.    @Stateful (name = “Bar”)
public class Barbean implements Bar {
public void bar () {}
C.    @Stateful
public class BarBean implements Serializable, Bar {
public void bar () {}
D.    @Stateful (name = “bar”)
public class BarBean implements Serializable, Bar {
public void bar () throws java.rmi.RemoteException {}

Answer: C

QUESTION 6
A developer creates a stateful session bean that is used by many concurrent clients. The clients are written by other development team; and it is assumed that these clients might not remove the bean when ending their session. The number of concurrent sessions will be greater than the defined bean cache size. The developer must consider that the state of the session bean can be influenced by either passivation or timeout. Which three actions should the developer take to make the bean behave correctly in passivation and timeout situations? (Choose three.)

A.    Release references to resources in a @Remove annotated method.
B.    Re-establish references to resources in an omit annotated method.
C.    Release references to resources in a @preDestroy annotated method.
D.    Release references to resources in a SPrePassivate annotated method.
E.    Re-establish references to resources in a @PostActivate annotated method.

Answer: CDE

QUESTION 7
A stateful session bean contains a number of instance variables. The types of instance variables A and B are serializable. Instance variable B is a complex type which is populated by many business calls, and can, therefore, not be refilled by the client without starting all over. A helper instance variable C is defined as having a Serializable type, and can hold all the information which is in variable B. for example, B is of type XML-DOM tree and C of Type String. Which two solutions, when combined, maintain the state of the session bean over a passivation and activation by the container? (Choose two.)

A.    The value of helper variable C is used to create the value of Instance variable B in the beans no-arg constructor.
B.    The value of helper variable C is used to create the value of instance variable B in a @postcreate annotated method.
C.    The value of helper variable C is used to create the value of instance variable B in a @postActivate annotated method.
D.    Instance variable A must be made null and instance variable B must be converted to a Serializable type and assigned to another instance variable in a @preDestroy annotated method.
E.    Instance variable A must be defined transient. Instance variable B must be converted to a Serializable type, set to null, and assigned to the instance variable C in a @PrePassivate annotated method.

Answer: CE

QUESTION 8
A developer creates a stateless session bean. This session bean needs data from a remote system. Reading this data takes a long time. Assume that the data will NOT change during the life time of the bean and that the information to connect to the remote system is defined in JNDI. Which statement describes how to manage the data correctly?

A.    Read the data in the bean’s constructor.
B.    The data can only be read in the bean’s business methods.
C.    Read the data in a method which is annotated with @PrePassivate.
D.    Read the data in a method which is annotated with @PostActivate.
E.    Read the data in a method which is annotated with @PostConstruct.

Answer: E

QUESTION 9
Assume a client will be accessing a Singleton bean. Which client views is a Singleton bean capable of exposing? (Choose two)

A.    Web Service
B.    Message listener
C.    EJB 2.x Remote Home
D.    EJB 3.x local business
E.    Java Persistence API entity

Answer: AB

QUESTION 10
A developer writes a stateful session bean FooBean with two local business interfaces Foo and bar. The developer wants to write a business method called getBar for interface Foo that returns a Bar reference to the same session bean identity on which the client onvokes getBar.
Which code, when inserted on line 12 below implements the getBar method with the wanted behavior?
10. @Resource SessionContext sessionCtx;
11. public Bar getbar () {
12.
13. }

A.    Return (bar) this;
B.    Return (bar) new FooBarBean();
C.    Return (bar) sessionCtx.lookup(“FooBarBean”)
D.    Return (bar) sessionCtx.getBusinessObject(Bar.class);
E.    Return (bar) session Ctx.lookup(“java: comp/env/ejb/FooBarBean”);

Answer: D


Latest Update Real PassLeader 1Z0-895 Exam Brian Dumps For Free Download

http://www.passleader.com/1z0-895.html