Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: bd0ea2eb863e8a5fc63676acb20c51f5c9eff90c (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
68
69
70
71
72
73
74
75
76
77
78
79
80
/*******************************************************************************
 * Copyright (c) 2013, 2014 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.tcf.processes.core.model.interfaces.runtime;

import org.eclipse.tcf.protocol.IChannel;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.tcf.core.model.interfaces.services.IModelRefreshService;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;

/**
 * Interface to be implemented by processes runtime model refresh services.
 */
public interface IRuntimeModelRefreshService extends IModelRefreshService {

	/**
	 * Interface to be implemented by processes runtime model refresh service delegates.
	 */
	public static interface IDelegate {

		/**
		 * Called from the processes runtime model refresh service after having queried the
		 * system monitor and the process context objects. Can be used to initialize the node
		 * type.
		 * <p>
		 * This method is invoked before {@link #postRefreshContext(IChannel, IProcessContextNode, ICallback)}.
		 * <p>
		 * <b>Note:</b> The method must be called in the TCF event dispatch thread.
		 *
		 * @param parentContextId The parent context id or <code>null</code> for the root context.
		 * @param node The process context node. Must not be <code>null</code>.
		 */
		public void setNodeType(String parentContextId, IProcessContextNode node);

		/**
		 * Called from the processes runtime model refresh service after having queried the
		 * system monitor and the process context objects. Can be used to initiate additional
		 * context node specific queries.
		 * <p>
		 * This method is invoked after {@link #setNodeType(IProcessContextNode)}.
		 * <p>
		 * <b>Note:</b> The method must be called in the TCF event dispatch thread.
		 *
		 * @param channel An open channel. Must not be <code>null</code>.
		 * @param node The process context node. Must not be <code>null</code>.
		 * @param callback The callback to invoke once the operation is completed. Must not be <code>null</code>.
		 */
		public void postRefreshContext(IChannel channel, IProcessContextNode node, ICallback callback);

		/**
		 * Returns the list of property names the delegate may add to a given process
		 * context node while executing {@link #postRefreshContext(IChannel, IProcessContextNode, ICallback)}.
		 *
		 * @return The list of managed property name or <code>null</code>.
		 */
		public String[] getManagedPropertyNames();
	}

	/**
	 * Refresh the content of the model from the top to the given maximum depth.
	 *
	 * @param callback The callback to invoke once the refresh operation finished, or <code>null</code>.
	 * @param depth Maximum depth or <code>-1</code> for full depth.
	 */
	public void refresh(ICallback callback, int depth);

	/**
	 * Auto refresh the content of the model from the top. It search for
	 * all nodes with query state "done" and refresh them one by one.
	 *
	 * @param callback The callback to invoke once the refresh operation finished, or <code>null</code>.
	 */
	public void autoRefresh(ICallback callback);
}

Back to the top