Jun 2016 updated: 70-680 measureup practice test

Breathing of 1Z0-895 vce materials and preparation exams for Oracle certification for IT professionals, Real Success Guaranteed with Updated 1Z0-895 pdf dumps vce Materials. 100% PASS Java Platform, Enterprise Edition 6 Enterprise JavaBeans Developer Certified Expert Exam exam Today!

2016 Jun 1Z0-895 Study Guide Questions:

Q51. 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 declared as the default interceptor. 

FooBean is a stateless session bean with a local business interface Foo that declares a method Foo (): 

10. @Stateless 

11. @Interceptors(AInt.class) 

12. public class FooBean Implements Foo { 

13. 

14. @Interceptors (BInt.class) 

15. @ExcludeClassInterceptors 

16. public void foo () {} 

17. } 

What is the interceptor order when the business method foo () is invoked? 

A. BInt 

B. CInt, BInt 

C. CInt, AInt, BInt 

D. BInt, AInt, CInt 

Answer: B 

Explanation: The default Intercepter, CInt, comes first. The class intercepter AInt is excluded by @ExcludeClassInterceptors, so the Method Intercepter BInt would be next in order. 

Note 1: By default the ordering of interceptors when invoking a method are 

* External interceptors ** Default interceptors, if present ** Class interceptors, if present ** Method interceptors, if present 

* Bean class interceptor method Note 2: Annotation Type ExcludeClassInterceptors Used to exclude class-level interceptors for a business method or timeout method of a target class. 

Reference: EJB Interceptors 

http://docs.jboss.org/ejb3/app-server/tutorial/interceptor/interceptor.html 

Q52. Given this code snippet from a JMS message driven bean class X: 

When this bean class handles a message, which is correct? 

A. After a message delivery the result is 1. 

B. After a message delivery the result is 2. 

C. After a message delivery the result is 12. 

D. After a message delivery an exception is thrown. 

E. After a message delivery the result is unpredictable. 

F. This is NOT a compliant JMS message-driven bean. 

Answer: F 

Q53. 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 business method bar in BrBean. 

Given: 

What is the expected result of this method invocation assuming control reaches Line 12? 

A. FooBean.foo method receives MyAppException. 

B. The container discards the BarBean bean instance. 

C. FooBean.foo method receives a javax.ejb.EJBException that wraps MyAppException. 

D. FooBean.foo method receives javax.transaction.TransactionRolledbackException. 

Answer: D 

Explanation: The transaction will roll back. 

Note: 

* In bean-managed transaction demarcation, the code in the session or message-driven bean explicitly marks the boundaries of the transaction. Although beans with container-managed transactions require less coding, they have one limitation: When a method is executing, it can be associated with either a single transaction or no transaction at all. If this limitation will make coding your bean difficult, you should consider using bean-managed transactions. 

Reference: The Java EE 5 Tutorial, Bean-Managed Transactions  

1Z0-895  exam price

Most up-to-date exam 70-680 windows 7 configuration pdf:

Q54. Which is a valid use of the EJB 3.x TimerHandle object? 

A. To retrieve all active timers associated with this bean 

B. To adapt EJB 3.x timers to EJB 2.1 and earlier timers 

C. To obtain a seralizable timer handle that may be persisted 

D. To be implemented by EJB classes that are to be registered with the timer service 

Answer: C 

Explanation: The TimerHandle interface allows the bean provider to obtain a serializable timer handle that may be persisted. 

Since timers are local objects, a timer handle must not be passed through a bean's remote business interface, remote interface or web service interface. 

Reference: javax.ejb, Interface TimerHandle 

Q55. Given Singleton bean FooEJB: 

FooEJB is packaged as the only bean in an ejb-jar and deployed to a server instance. Which represents the output generated from FooEJB after the deployment has completed? 

A. Init 

B. foo 

C. Init foo 

D. <no output> 

E. a or d 

Answer: A 

Explanation: Note: 

* The PostConstruct annotation is used on a method that needs to be executed after dependency injection is done to perform any initialization. This method MUST be invoked before the class is put into service. This annotation MUST be supported on all classes that support dependency injection. The method annotated with PostConstruct MUST be invoked even if the class does not request any resources to be injected. Only one method can be annotated with this annotation. The method on which the PostConstruct annotation is applied MUST fulfill all of the following criteria – -The method MUST NOT have any parameters except in the case of EJB interceptors in which case it takes an InvocationC ontext object as defined by the EJB specification. – The return type of the method MUST be void. – The method MUST NOT throw a checked exception. – The method on which PostConstruct is applied MAY be public, protected, package private or private. – The method MUST NOT be static except for the application client. – The method MAY be final. – If the method throws an unchecked exception the class MUST NOT be put into service except in the case of EJBs where the EJB can handle exceptions and even recover from them. 

* PostConstruct methods are invoked on the newly constructed instance, after any dependency injection has been performed by the container and before the first business method is invoked on the bean. 

Q56. 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 session bean FooBean with a local business interface Foo that declares a method foo (): 

10. @Stateless 

11. @Intercaptors ({CInt.class, BInt.class}) 

12. public class FooBean implements Foo { 

13. 

14. public void foo () {} 

15. 

16. } 

The ejb-jar contains a META-INF/ejb-jar.xml file with an <interceptor-binding> section: 

<interceptor-binding> <ejb-name>FooBean</ejb-name> <interceptor-order> <interceptor.class>com.acme.AInt</interceptor-class> </interceptor-order> 

</interceptor.binding> 

What is the interceptor order when the business methodfoo() is invoked? 

A. AInt 

B. AInt, CInt, BInt 

C. CInt, BInt, AInt 

D. AInt, BInt, CInt 

Answer: B 

Explanation: With the interceptor-order clauses Aint will be first in the order of interceptors. 

Within each group (default, class, method) the order of the interceptors are from left to right as defined in the @Interceptors annotation, and then the xml interceptors. 

In this scenario, with the @Intercaptors ({CInt.class, BInt.class}) line, the ordering continues with CInt and BInt. 

Note 1: By default the ordering of interceptors when invoking a method are 

* External interceptors ** Default interceptors, if present ** Class interceptors, if present ** Method interceptors, if present 

* Bean class interceptor method Note 2: You can override the default sort order of the external interceptors by specifiying an interceptor-binding with an interceptor-order specifying the order of the interceptors 

Reference: EJB Interceptors 

http://docs.jboss.org/ejb3/app-server/tutorial/interceptor/interceptor.html 

1Z0-895  exam price

Approved windows 7 configuration exam 70-680 questions and answers:

Q57. Given the following stateful bean: 

10. @Stateful 

11. @TransactionAttribute(TransactionAttributeType.SUPPORTS) 

12. public class VideoBean implements video { 

13. / / insert code here 

14. public void method () {} 

15. } 

Assuming no other transaction-related metadata, which code can be added at line 13 to guarantee that business method methodA will execute only if invoked with an active transaction? 

A. @TransactionAttribute () 

B. @transactionmanagement(TransactionAttributeType.CONTAINER) 

C. @TransactionAttribute(transactionAttributeType.MANDATORY) 

D. @transactionAttribute(TransactionattributeType.RECQUIRES_NEW) 

Answer: C 

Q58. Assume an EJB application is comprised of the following EJB fragment: 

You have been asked to convert the type of InventoryReportBean into a singleton session bean. How would you achieve this task? 

Exhibit C: 

Exhibit D: 

A. Keep InventoryReportBean as it is, modifying the internal structure to function as a singleton 

B. Change the @Stateless annotation of InventoryReportBean to @Singleton 

C. Create an ejb-jar.xml file, and override the annotation configuration information as in exhibit C above. 

D. Create an ejb-jar.xml file, and override the annotation configuration information as in exhibit D above. 

Answer: D 

Explanation: Note the line with <override-type> 

Q59. A developer writes a stateful session bean with local business interface Bar containing method test. Method test is implemented as: 

11. @Remove 

12. public void test () {} 

A business method in a stateless session bean invokes a reference to bean Bar as follows: 

11. @EJB Bar bar; 

12. 

13. public void foo () { 

14. bar.test (); 

15. bar.test(); 

16. } 

Assuming execution reaches Line 15, what is the expected result? 

A. Method foo returns without error. 

B. A javax.ejb.NoSuchEJBException is thrown. 

C. A java.rmi.NoSuchObjectException is thrown. 

D. A javax.ejb.NoSuchEntityException is thrown. 

Answer: B 

Q60. A developer writes an interceptor class called FooInterceptor containing the following AroundInvoke method: 

11. @AroundInvoke 

12. public Object intercept (InvocationContext ctx) { 

13. return “intercepted”; 

14. } 

FooInterceptor is applied to a business method in a stateless session bean: 

11. @Interceptors (FooInterceptor.class) 

12. public String testzero(int i) { 

13. return (i = = 0) ? “zero”: “not zero” 

14. } 

Which describes the result when a client invokes the testzero method with a value of 1? 

A. The interceptor method is NEVER invoked. 

B. The client receives a return value of “zero”. 

C. The client receives a return value of “not zero”. 

D. The client receives a return value of “intercepted”. 

Answer: D 

About 1Z0-895 Information: 1Z0-895 Dumps

Certleader Dumps
Certleader is a company specialized on providing high quality IT exam materials and fully committed to assist our respected clients crack any IT certification tests on their 1st efforts.