1Z0-895 Exam Questions
84 real 1Z0-895 exam questions with expert-verified answers and explanations. Page 1 of 2.
- Question #1
You are writing a client that sends a message to a JMS queue. What two statements are true?
- Question #2
You are writing a client that sends a message to a JMS queue. The client includes the following code snippet:
- Question #3
Given the following stateless session bean implementation classes: Assuming no other transaction-related metadata, what are the transaction attributes of methodA, methodB, and meth...
- Question #4
A developer implements a system in which transfers of goods are monitored. Each transfer needs a unique ID for tracking purposes. The unique ID is generated by an existing system w...
- Question #7
A Java EE application server has four different security realms for user management. One of the security realms is custom made. This realm supports only individual user entries, no...
- Question #9
A developer writes a stateless session bean HelloBean that exposes a local business interface Hello: The developer wants to test HelloBean using the EJB 3.1 Embeddable API. Given a...
- Question #10
You have been tasked to build a jar file that can be used by a Java SE client to access the remote instance of the OrderProcessingBean. Given the following design: Which classes wo...
- Question #12
MyMsgBean is a JMS message-driven with container-managed transaction demarcation. FooBean is an EJB 3.x stateless session bean that sends messages to the JMS destination with which...
- Question #13
FooBean and BarBean are both EJB 3.x stateless session beans with bean-managed transaction demarcation. The business method foo in FooBean starts a UserTransaction and invokes the...
- Question #14
A developer needs to deliver a large-scale enterprise application that connects developer chooses an EJB 3.1-compliant application server, which three are true about the EJB busine...
- Question #15
A developer examines a list of potential enterprise applications and selects the most appropriate technologies to use for each application. For which two applications is EJB an app...
- Question #16
Which two statements are true? (Choose two.)
- Question #17
Assume you would like to receive notification from the container as a stateless session bean transitions to and from the ready state. Which of the following life cycle back annotat...
- Question #18
Which API must an EJB 3.1 container make available to enterprise beans at runtime? (Choose one)
- Question #19
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. }...
- Question #20
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 n...
- Question #21
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...
- Question #22
A developer writes a stateful session bean FooBean with one remote business interface Foo. Foo defines an integer / setter method pair implemented as: 10. private int value; 11. pu...
- Question #23
A developer writes a stateless session bean FooBean with one remote business interface FooRemote containing one business method foo. Method foo takes a single parameter of applicat...
- Question #24
Which two statements are correct about stateless session beans? (Choose two.)
- Question #25
A developer wants to release resources within a stateless session bean class. The cleanup method should be executed by the container before an instance of the class is removed. The...
- Question #28
Suppose an EJB named HelloWorldBean is deployed as a standalone ejb-jar. Assuming the HelloWorldBean is implemented as follows: Which HelloWorldBean methods are accessible by anoth...
- Question #29
Given the following stateless session bean: How would you change the EJB to prevent multiple clients from simultaneously accessing the sayHello method of a single bean instance?
- Question #30
Given singleton bean FooEJB: How many distinct FooEJB bean instances will be used to process the code on the lines 101- 105?
- Question #31
Given the following client-side code that makes use of the session bean Foo: 10. @EJB Foo bean1; 12. @EJB Foo bean2; // more code here 20. boolean test1 = beanl.equals(bean1); 21....
- Question #32
A developer writes a Singleton bean that holds state for a single coordinate: An update thread acquires an EJB reference to CoordinateBean and alternates between invoking SetCoordi...
- Question #33
A developer writes a Singleton bean that uses the java Persistence API within a business method: Two different concurrently executing caller threads acquire an EJB reference to Per...
- Question #34
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 th...
- Question #35
Given the following code in an EJB session bean: Which code, inserted at Line 15, portably looks up the injected resource?
- Question #36
A developer is writing client code to access a session bean deployed to a server instance. The client can access the session bean under which of these circumstances? (Choose three)
- Question #37
A developer writes three interceptor classes: AInt, BInt, and CInt. Each interceptor class defines an AroundInvoke method called interceptor. In the ejb-jar.xml descriptor, CInt is...
- Question #38
An ejb-jar also contains three interceptor classes: AInt, BInt, CInt. Each interceptor class defines an AroundInvoke method called intercept. The ejb-jar also contains a stateless...
- Question #39
How many interceptor classes can be applied to a single stateful session bean?
- Question #40
A developer writes an interceptor class called FooInterceptor containing the following AroundInvoke method: 11. @AroundInvoke 12. public Object intercept (InvocationContext ctx) {...
- Question #41
A bean developer wants to write a stateless session bean class that implements the following remote business interface: @Remote Public interface Foo { Void bar () throws Exception;...
- Question #42
Which is true about caller security principal propagation for asynchronous EJB method Invocations?
- Question #43
A bean developer writes a stateless session bean FooEJB with the following asynchronous business method: @Asynchronous public Future<Integer> fooAsync () { System.out.printIn ("beg...
- Question #44
Given two stateless session beans, ABean and BBean: A client that is not executing within a transaction acquires an EJB reference to ABean and invokes the a() method on time. How m...
- Question #45
Given this code snippet from a JMS message driven bean class X: When this bean class handles a message, which is correct?
- Question #46
Which statement about message-driven beans is correct?
- Question #47
Given code snippets from two files: Which four code changes, when used together, create a valid JMS message-driven bean? (Choose four)
- Question #48
Which is a valid Postconstruct method in a message-driven bean class?
- Question #49
Which statement is correct about a Java EF client of a message driven bean?
- Question #50
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 ja...
- Question #51
You are writing a client that sends a message to a JMS queue. Which statement is true?
- Question #52
Which two are true about the client view of a message-driven bean? (Choose two.)
- Question #53
Given the following stateful bean: 10. @Stateful 11. @TransactionAttribute(TransactionAttributeType.SUPPORTS) 12. public class VideoBean implements video { 13. / / insert code here...
- Question #54
Given the stateful session bean: Assuming no other transaction-related metadata, which is true?
- Question #57
A developer implements a session bean which acts as a session facade for an application. This means that clients will only see this session bean's interface which offers the applic...
- Question #58
A java EE application contains a session bean which uses a security role USER. A group called people is defined an LDAP server. Which two define appropriate EJB role responsibiliti...