Hello Ranchers,
I am studying for EJB3.x certification and have questions regarding EJB3.x
SessionSychronization and
Asychronous method calls on bean instances.
1. SessionSynchronization: If annotations are used to designate callback methods, does the the method annotated with
@AfterCompletion have to include a boolean as its sole parameter in it's signature like its equivalent
SessionSynchronization.afterCompletion(boolean). Can it define other parameters. Is it restricted with access modifiers and can it return values (even if it makes no sense to do this?) .
Also if a method defined with
@Remove metadata without specifying the attribute
retainIfException, what default value would be used. "True" or "False"?
2. @Asynchronous: After the bean method is invoked asynchronously at which point does the client receive a
Future<V> object assuming the method called was declared to return a result? Is it immediately after control has been returned to the client or after the method has completed execution or thrown an error? If immediately after control is returned to the client, how does the client get to know about important events in the asynchronous call such as error or completion. Does it register a listener or maybe just make random guesses or optimistic synchronous checks, anticipating some kind of progress or useful feedback from the call it initiated?
I will appreciate explanations with good examples citing best practices.
Thank you.