📄 ejbasynccallback.java
字号:
/**
* javax.ejb.async - Proposed Classes/Interfaces for EJB Async support
*
* @version 1.1
* @author Andrzej Jan Taramina, Chaeron Consulting Corporation
*/
package javax.ejb.async;
//***************************************************************************
//*
//* Imports
//*
//***************************************************************************/
//***************************************************************************
//*
//* EJBAsyncCallback Interface definition
//*
//***************************************************************************/
/**
* The <code>EJBAsyncCallback</code> interface should be implemented by any class
* that will be used to receive and process a callback resulting from the completion
* of an EJB asynchronous operation.
* <p>
* A remote method invocation on an EJB Bean (Session or Entity) will be processed
* asynchronously if and only if one of the parameters passed to the method invocation
* is of type EJBAsyncCallback. It is proposed that the last parameter in the list would
* be the EJBAsyncCallback, except in the situation where a client context object is being
* passed in by the user, in which case the callback is the second last parameter and the
* context object would be the last parameter.
* <p>
* When an EJB Async remote method invocation has completed, the asyncMethodCompleted()
* method will be called in the specified EJBAsyncCallback object by the EJB Server
* (more specifically by the client EJBObject stub) and will be passed an EJBAsyncResponse
* object that contains the return value of the remote method invocation or an exception.
* <p>
* For example, if you have an Entity bean called myBean whose interface is defined as follows:
* <p><pre><blockquote>
* public interface myBean extends EJBObject
* {
* public void doSomething( String parmValue ) throws RemoteException;
* public void doSomething( String parmValue, EJBAsyncCallback cb ) throws RemoteException;
* }
* </blockquote></pre>
* If you issue the first doSomething() method, the invocation will be normal (Synchronous), however
* if you issue the second doSomething() method, specifying an EJBAsyncCallback object for the second
* parameter, then the invocation will be asynchronous. If you specify the second form of the call
* and pass in a null callback object, then the call will also be synchronous and equivalent to the first
* method.
* <p>
* Optionally you can also include a client context object that will be returned to you in the
* EJBAsyncResult object passed to the EJBAsyncCallback. The client context object can be any
* Java Object that the user wishes to get access to in the EJBAsyncCallback and could be used to
* identify the method invocation or other contextual information about the specific method
* invocation as follows:
* <p><pre><blockquote>
* public interface myBean extends EJBObject
* {
* public void doSomething( String parmValue, EJBAsyncCallback cb, Object clientContext ) throws RemoteException;
* }
* </blockquote></pre>
*
* @see javax.ejb.async.EJBAsyncResult
*
* @author Andrzej Jan Taramina, Chaeron Consulting Corporation
* @version 1.1, 03/17/99
*/
public interface EJBAsyncCallback
{
//***************************************************************************
//*
//* EJBAsyncCallback method signatures
//*
//***************************************************************************/
/**
* When an EJB Async remote method invocation has completed, the asyncMethodCompleted()
* method will be called.
*
* @param result An EJBAsyncResult object containing the return value of the
* remote method invocation or an exception.
*/
public void asyncMethodCompleted( EJBAsyncResult result );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -