Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 5514c31effc322e678e2ab786c5706fada51affe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*******************************************************************************
 * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
 * This program and the accompanying materials are made available under the terms
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
 * available at http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Wind River Systems - initial API and implementation
 *******************************************************************************/
package org.eclipse.tcf.te.runtime.interfaces.callback;

import javax.security.auth.callback.Callback;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;


/**
 * Generic callback interface for asynchronous calls.
 *
 * @noimplement Not intended to be implemented by clients, use {@link Callback} as base implementation instead.
 * @noextend
 */
public interface ICallback extends IPropertiesContainer {

	/**
	 * Returns if or if not the callbacks <code>done</code> method
	 * was called already.
	 *
	 * @return <code>True</code> if {@link #done(Object, IStatus)} was called already, <code>false</code> otherwise.
	 */
	public boolean isDone();

	/**
	 * Callback method invoked when a request is completed.
	 *
	 * @param caller
	 *            The caller or <code>null</code>.
	 * @param status
	 *            The status. Must not be <code>null</code>.
	 */
	public void done(Object caller, IStatus status);

	/**
	 * Add an additional parent callback to the end of the parent callback list.
	 *
	 * @param callback
	 *            The parent callback. Must not be <code>null</code>.
	 */
	public void addParentCallback(ICallback callback);

	/**
	 * Sets the result of an asynchronous operation to be carried by
	 * the callback object.
	 *
	 * @param result The result object or <code>null</code>.
	 */
	public void setResult(Object result);

	/**
	 * Gets the result of an asynchronous operation which is carried by
	 * the callback object.
	 *
	 * @return The result object or <code>null</code>.
	 */
	public Object getResult();
}

Back to the top