nerdexam
Oracle

1Z0-895 · Question #86

A stateless session bean FooBean implements an asynchronous business method foo() on its bean class: @Asynchronous public void foo() ( ... ) The asynchronous business method is exposed through a…

The correct answer is A. java.rmi.RemoteException. *RemoteRef represents the handle for a remote object. A RemoteStub uses a remote reference to carry out a remote method invocation to a remote object. public Object invoke(Remote obj, Object[] params, throws Exception Invoke a method. This form of delegating method invocation…

Session Beans

Question

A stateless session bean FooBean implements an asynchronous business method foo() on its bean class: @Asynchronous public void foo() ( ... ) The asynchronous business method is exposed through a remote business interface FooRemote. A caller acquires an EJB reference to this bean and invokes it as follows: 100. fooRemoteRef.foo(); Which exception can result from the invocation on line 100?

Options

  • Ajava.rmi.RemoteException
  • Bjava.util.concurrent.ExecutionException
  • Cjavax.ejb.EJBException
  • Djava.lang.IllegalArgumentException

How the community answered

(67 responses)
  • A
    75% (50)
  • B
    4% (3)
  • C
    7% (5)
  • D
    13% (9)

Explanation

*RemoteRef represents the handle for a remote object. A RemoteStub uses a remote reference to carry out a remote method invocation to a remote object. public Object invoke(Remote obj, Object[] params, throws Exception Invoke a method. This form of delegating method invocation to the reference allows the reference to take care of setting up the connection to the remote host, marshaling some representation for the method and parameters, then communicating the method invocation to the remote host. This method either returns the result of a method invocation on the remote object which resides on the remote host or throws a RemoteException if the call failed or an application-level exception if the remote invocation throws an exception.

Topics

#asynchronous methods#@Asynchronous#remote interface#RemoteException

Community Discussion

No community discussion yet for this question.

Full 1Z0-895 Practice