1Z0-895 Exam Questions
84 real 1Z0-895 exam questions with expert-verified answers and explanations. Page 1 of 2.
- Question #1Server Installation and Configuration
You are writing a client that sends a message to a JMS queue. What two statements are true?
JMSresource injectionJNDI lookupJava EE client - Question #2Server Installation and Configuration
You are writing a client that sends a message to a JMS queue. The client includes the following code snippet:
JMSMapMessageMessageProducerdelivery mode - Question #3Server Installation and Configuration
Given the following stateless session bean implementation classes: Assuming no other transaction-related metadata, what are the transaction attributes of methodA, methodB, and meth...
CMTtransaction attributessession beanMANDATORY - Question #4Performance Tuning
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...
CMTREQUIRES_NEWtransaction demarcationNOT_SUPPORTED - Question #7Security
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...
security realmsecurity rolesRunAs annotationrole mapping - Question #9Server Installation and Configuration
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...
EJB Embeddable APIEJBContainerInitialContextJNDI lookup - Question #10Server Installation and Configuration
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...
client jarremote interfaceEJB packagingJava EE deployment - Question #12High Availability
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...
MDBCMTRuntimeExceptiontransaction rollback - Question #13Server Installation and Configuration
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...
BMTUserTransactionexception propagationTransactionRolledbackException - Question #14High Availability
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...
EJB containerload balancingclusteringJava EE 6 compliance - 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 #16Server Installation and Configuration
Which two statements are true? (Choose two.)
remote accesslocal accessEJB container servicescoarse-grained design - Question #17Server Installation and Configuration
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...
lifecycle callbacksPostConstructPreDestroystateless session bean - 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 #22Performance Tuning
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...
stateful session beanejb-refbean identitystate isolation - 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 #24Server Installation and Configuration
Which two statements are correct about stateless session beans? (Choose two.)
stateless session beaninstance variablesbean poolingconcurrency - 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 #29High Availability
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?
singleton beansynchronized methodthread safetyconcurrent access - Question #30Server Installation and Configuration
Given singleton bean FooEJB: How many distinct FooEJB bean instances will be used to process the code on the lines 101- 105?
singleton beanbean instancesEJB lifecyclecontainer managed - 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 #32High Availability
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...
singleton beanlock contentionread/write concurrencycontainer locking - Question #33Transactions
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...
Singleton beanconcurrent accesscontainer-managed transactionsJPA - 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 #36Session Beans
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)
local interfaceremote interfaceno-interface viewclient access - Question #37Interceptors
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...
interceptor orderingdefault interceptorsExcludeClassInterceptorsAroundInvoke - Question #38Interceptors
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...
interceptor orderinginterceptor-bindingejb-jar.xmlinterceptor-order element - Question #39Interceptors
How many interceptor classes can be applied to a single stateful session bean?
interceptor classesstateful session beanmultiple interceptors - Question #40
A developer writes an interceptor class called FooInterceptor containing the following AroundInvoke method: 11. @AroundInvoke 12. public Object intercept (InvocationContext ctx) {...
- Question #41Session Beans
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;...
asynchronous methodsFuture return typeremote business interface@Asynchronous - Question #42Security
Which is true about caller security principal propagation for asynchronous EJB method Invocations?
security principal propagationasynchronous invocationcaller principal - Question #43Session Beans
A bean developer writes a stateless session bean FooEJB with the following asynchronous business method: @Asynchronous public Future<Integer> fooAsync () { System.out.printIn ("beg...
asynchronous methodsFutureAsyncResultcancel - Question #44Transactions
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...
REQUIRED transaction attributeUserTransactiontransaction propagationstateless session beans - 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 #50JMS and Message-Driven Beans
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...
JMS connection factory@Resource injectionJNDI lookupresource-ref - Question #51JMS and Message-Driven Beans
You are writing a client that sends a message to a JMS queue. Which statement is true?
JMS session creationconnection factorytransacted sessionacknowledgment mode - Question #52JMS and Message-Driven Beans
Which two are true about the client view of a message-driven bean? (Choose two.)
message-driven bean client viewmessage destinationJNDI namespace - 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...