Exam dumps, software Testing engine Testcenter Oracle 1Z0-895 cert24
Exam dumps, software Testing engine Testcenter Oracle 1Z0-895 cert24
IT Exam,IT Certification,braindump,original questions, question pool,document, braindump, test questions, test question, dumps, test answers, cert24.com, preparation, pdf, certification questions, answers Certification, certification test, practice test, exam dumps, certification training, answers real questions
1Z0-895 Java Platform, Enterprise Edition 6 Enterprise JavaBeans Developer Certified Expert Exam our products come with a 100% guarantee of success. We hold this claim because of the highly dedicated and expert team that we have and because of our past performance.
QUESTION NO: 1
Which statement is correct about a Java EF client of a message driven bean?
A. The client can use JNDI to obtain a reference to a message destination.
B. The client can use JNDI to obtain a reference to a dependency injection.
C. The client can use JNDI to obtain a reference to a message-driven bean instance.
D. The client can use JNDI to look up a reference to the message-driven bean’s home interface.
Answer: A
QUESTION NO: 2
You are writing an EE component that functions as a message producer. The message producer sends message to a JMS queue. The component environment defines a resource-ref of type javax.jms.ConnectionFactory with the same jms/ConnectionFactory.
Which will correctly obtain a connection factory for a queue?
A. Context context = new initialContext();
Connectionfactory confac = (ConnectionFactory) Context.lookup
(“java: comp/env/jms/ConnectionFactory”);
B. InitialContext Context = new Context () ;
QueueConnectionFactory confac = (QueueConnectionFactory) context.lookup
(“java: comp/env/jms/Myfactory”);
C. @Resource (“ConnectionFactory”)
private static QueueConnectionFactory confac;
D. @Resource (loopkup = “jms/QueueConnectionFactory”)
private static ConnectionFactoryconfac;
Answer: D
Explanation:
A connection factory is the object a client uses to create a connection to a
provider. A connection factory encapsulates a set of connection configuration parameters that has been defined by an administrator. Each connection factory is an instance of
theConnectionFactory, QueueConnectionFactory, or TopicConnectionFactory interface
At the beginning of a JMS client program, you usually inject a connection factory resource into a ConnectionFactory object. For example, the following code fragment specifies a resource whose JNDI name is jms/ConnectionFactory and assigns it to a ConnectionFactory object:
@Resource(lookup = “jms/ConnectionFactory”)
private static ConnectionFactory connectionFactory;
Reference:The Java EE 6 Tutoria,The JMS API Programming Model
QUESTION NO: 3
You are writing a client that sends a message to a JMS queue. Which statement is true?
A. You use a connection factory to create a session.
B. When you create a session, you specify whether or not it is transacted.
C. When you create a connection, you specify the acknowledgment mode.
D. When you create a message producer, you must specify the name of the destination to which you will send messages.
Answer: A
Explanation:
Note:
The SimpleMessageClient sends messages to the queue that the SimpleMessageBean listens to.
The client starts by injecting the connection factory and queue resources:
@Resource(mappedName=”jms/ConnectionFactory”)
private static ConnectionFactory connectionFactory;
@Resource(mappedName=”jms/Queue”)
private static Queue queue;
Next, the client creates the connection, session, and message producer:
connection = connectionFactory.createConnection();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
messageProducer = session.createProducer(queue);
Finally, the client sends several messages to the queue:
message = session.createTextMessage();
for (int i = 0; i < NUM_MSGS; i++) {
message.setText(“This is message ” + (i + 1));
System.out.println(“Sending message: ” + message.getText());
messageProducer.send(message);
Exam dumps, software Testing engine Testcenter Oracle 1Z0-895 cert24