[
http://issues.apache.org/jira/browse/DIRMINA-120?page=comments#action_12357513
]
Trustin Lee commented on DIRMINA-120:
-------------------------------------
Thanks for the patch!
I modified your path a little bit:
public interface Callback
{
/**
* Invoked when the operation associated with the [EMAIL PROTECTED]
IoFuture}
* succeeded.
*
* @param source The source [EMAIL PROTECTED] IoFuture} which called
this
* callback.
* @param result The result value of the operation. Its type
* depends on what I/O operation you requested.
*/
public void operationSucceeded( IoFuture source, Object result );
/**
* Invoked when the operation associated with the [EMAIL PROTECTED]
IoFuture}
* failed.
*
* @param source The source [EMAIL PROTECTED] IoFuture} which called
this
* callback
* @param cause The cause of failure
*/
public void operationFailed( IoFuture source, Throwable cause );
}
Providing two methods by default, I think we don't need to add ConnectListener
or other possible listeners IMHO though this will cause an inevitable
downcasting. WDYT?
> Callbacks for IoFutures
> -----------------------
>
> Key: DIRMINA-120
> URL: http://issues.apache.org/jira/browse/DIRMINA-120
> Project: Directory MINA
> Type: Improvement
> Reporter: Trustin Lee
> Assignee: Trustin Lee
> Fix For: 0.9
> Attachments: ConnectFuture.java, IoFuture.java
>
> IoFuture provides only blocking-way ('join' method) for user to find out the
> result of an I/O request. It would be great if users can specify a callback:
> ConnectFuture future = connector.connect(...);
> future.setCallback( new ConnectFuture.Callback() {
> public void connectionEstablished( IoSession session ) {
> }
> public void connectionFailed( Throwable cause ) {
> }
> } );
> There can be a race condition if the connection process ends before a user
> calls setCallback() method, but we can resolve this carefully so users don't
> notice any issue.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira