Skip to main content
summaryrefslogtreecommitdiffstats
blob: 335fb430cab96520ee4623f8f1a2123b536375dc (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/*******************************************************************************
 * Copyright (c) 2004, 2005 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
/*


 */
package org.eclipse.jem.internal.proxy.remote;

import java.io.IOException;

import org.eclipse.jem.internal.proxy.common.CommandException;
import org.eclipse.jem.internal.proxy.common.remote.Commands;
 
/**
 * Additional function on a connection for expression tree processing.
 * Connections returned (IREMConnections) will always also implement IREMExpressionConnection,
 * but they are separated so that expression functions don't pollute the regular
 * connection interface with added commands that shouldn't be called except
 * when processing an expression. If they were called out of order, big problems
 * can occur.
 * <p>
 * To use, simply cast the IREMConnection to be an IREMExpressionConnection.
 * 
 * @since 1.0.0
 */
public interface IREMExpressionConnection extends IREMConnection {
	
	/**
	 * Start expression processing.
	 * @param expressionID 
	 * @param trace TODO
	 * @throws IOException
	 * 
	 * @since 1.0.0
	 */
	public void startExpressionProcessing(int expressionID, byte trace) throws IOException;
	
	/**
	 * Transfer the expression. This tells the remote vm to stop processing on the
	 * given connection and return the expression processing controller for the expression.
	 * 
	 * @param expressionID
	 * @param expController
	 * @throws IOException
	 * 
	 * @since 1.1.0
	 */
	public void transferExpression(int expressionID, Commands.ValueObject expController) throws CommandException;
	
	/**
	 * Resume the expression on this connection.
	 * @param expressionID
	 * @param expController expression processor controller to use for the expression on this new connection.
	 * @throws CommandException 
	 * 
	 * @since 1.1.0
	 */
	public void resumeExpression(int expressionID, Commands.ValueObject expController) throws CommandException;
	
	/**
	 * Push an expression command. This is the common portion of the
	 * subcommand. The actual data of the command will be separately done.
	 * @param expressionID 
	 * @param subcommand The subcommand being sent. From IInternalExpressionConstants.
	 * 
	 * @throws IOException
	 * 
	 * @see org.eclipse.jem.internal.proxy.initParser.tree.IInternalExpressionConstants#PUSH_TO_PROXY_EXPRESSION
	 * @since 1.0.0
	 */
	public void pushExpressionCommand(int expressionID, byte subcommand) throws IOException;
	
	/**
	 * Push the value object to the remote side.
	 * 
	 * @param valueObject
	 * @throws CommandException
	 * 
	 * @since 1.0.0
	 */
	public void pushValueObject(Commands.ValueObject valueObject) throws CommandException;

	/**
	 * Push just the single byte to the remote side.
	 * @param abyte
	 * @throws IOException
	 * 
	 * @since 1.0.0
	 */
	public void pushByte(byte abyte) throws IOException;
	
	/**
	 * Push just the single int to the remote side.
	 * 
	 * @param anInt
	 * @throws IOException
	 * 
	 * @since 1.0.0
	 */
	public void pushInt(int anInt) throws IOException;
	
	
	/**
	 * Push just the singe string to the remote side.
	 * 
	 * @param aString
	 * @throws IOException
	 * 
	 * @since 1.0.0
	 */
	public void pushString(String aString) throws IOException;
	
	/**
	 * Push just the bool to the remote side.
	 * @param aBool
	 * @throws IOException
	 * 
	 * @since 1.0.0
	 */
	public void pushBoolean(boolean aBool) throws IOException;
	
	/**
	 * Get the final value. It must be called after processing the proxy id resolutions even for sync (so that we can get
	 * any thrown errors).
	 * 
	 * @param result
	 * @throws CommandException
	 * 
	 * @since 1.1.0
	 */
	public void getFinalValue(Commands.ValueObject result) throws CommandException;
	
	/**
	 * Send the pull value command, with the proxyids of intereset. If an error
	 * occurs, command exception is thrown. 
	 * <p>
	 * After the pull value call, if no errors, the proxyids must be read, and then getFinalValue call must be sent.
	 * @param expressionID
	 * @param proxyids expression proxyids that request feedback or <code>null</code> if no proxy ids.
	 * @param sender sender to use to process the returned proxy ids, or <code>null</code> if expecting no proxy resolutions.
	 * 
	 * @throws CommandException
	 * 
	 * @since 1.0.0
	 */
	public void pullValue(int expressionID, Commands.ValueObject proxyids, Commands.ValueSender sender) throws CommandException;
	
	/**
	 * Send the sync command, with the proxyids of intereset. If an error
	 * occurs, command exception is thrown.
	 * <p>
	 * After the sync call, if no errors, the returned proxyids must be processed and then the final endValue call must be sent.
	 * 
	 * @param expressionID 
	 * @param proxyids expression proxyids that request feedback or <code>null</code> if no proxy ids.
	 * @param sender sender to use to process the proxy id resolutions, or <code>null</code> if expecting no proxy ids.
	 * 
	 * @throws CommandException
	 * 
	 * @since 1.0.0
	 */
	public void sync(int expressionID, Commands.ValueObject proxyids, Commands.ValueSender sender) throws CommandException;	
	
	/**
	 * Stop expression processing.
	 * @param expressionID 
	 * 
	 * @throws IOException
	 * 
	 * @since 1.0.0
	 */
	public void stopExpressionProcessing(int expressionID) throws IOException;

}

Back to the top