All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.sgi.sysadm.util.ResultListener

public interface ResultListener
extends EventListener
ResultListener methods are called when an operation succeeds or fails. The purpose of ResultListener is to provide a generic way for classes to define asynchronous methods. One of the parameters to such an asynchronous method is a ResultListener, which gets notified of the success or failure of the method. For example, the following code calls java.com.sgi.sysadm.ui.Task.runPriv, and causes the task to succeed or fail based on asynchronous notification about whether or not the runPriv operation succeeded.
 	stream = runPriv(privcmdName, taskData, new ResultListener() {
 	    public void succeeded(ResultEvent event) {
 		_taskContext.notBusy();
 		taskSucceeded(event);
 	    }
 	    public void failed(ResultEvent event) {
 		_taskContext.notBusy();
 		taskFailed(event);
 	    }
 	});
 


Method Index

 o failed(ResultEvent)
Called when an asynchronous operation fails.
 o succeeded(ResultEvent)
Called when an asynchronous operation succeeds.

Methods

 o succeeded
 public abstract void succeeded(ResultEvent event)
Called when an asynchronous operation succeeds. The result of the operation is typically accessible via event.getResult.

Parameters:
event - ResultEvent optionally containing result Object.
 o failed
 public abstract void failed(ResultEvent event)
Called when an asynchronous operation fails. The reason for the failure is typically accessible via event.getReason.

Parameters:
event - ResultEvent optionally containing reason for failure.

All Packages  Class Hierarchy  This Package  Previous  Next  Index