PageRenderTime 27ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/interpreter/tags/at2-build060407/src/edu/vub/at/objects/ATMessage.java

http://ambienttalk.googlecode.com/
Java | 82 lines | 10 code | 8 blank | 64 comment | 0 complexity | 79bdee132f857dfba6ec724c2c595d54 MD5 | raw file
 1/**
 2 * AmbientTalk/2 Project
 3 * ATMessageCreation.java created on 31-jul-2006 at 11:57:29
 4 * (c) Programming Technology Lab, 2006 - 2007
 5 * Authors: Tom Van Cutsem & Stijn Mostinckx
 6 * 
 7 * Permission is hereby granted, free of charge, to any person
 8 * obtaining a copy of this software and associated documentation
 9 * files (the "Software"), to deal in the Software without
10 * restriction, including without limitation the rights to use,
11 * copy, modify, merge, publish, distribute, sublicense, and/or
12 * sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following
14 * conditions:
15 *
16 * The above copyright notice and this permission notice shall be
17 * included in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
21 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */
28package edu.vub.at.objects;
29
30import edu.vub.at.exceptions.InterpreterException;
31import edu.vub.at.objects.grammar.ATSymbol;
32
33/**
34 * Instances of the class ATMessage represent first-class AmbientTalk asynchronous messages.
35 * They may be created explicitly using the <tt><-m(args)</tt> syntax, or implicitly during an
36 * asynchronous message send of the form <tt>o<-m(args)</tt>.
37 * 
38 * This interface is not to be confused with the ATMessageCreation interface in the grammar subpackage.
39 * That interface represents an abstract grammar object representing the syntax tree of message creation.
40 * This interface is the interface to the actual runtime message object.
41 * 
42 * @author tvcutsem
43 */
44public interface ATMessage extends ATObject {
45	
46	/**
47	 * Messages always have a selector, a symbol denoting the field or method that 
48	 * needs to be sought for.
49	 * @return a symbol denoting the selector
50	 */
51	public ATSymbol base_getSelector() throws InterpreterException;
52	
53	/**
54	 * Messages may optionally have a table of arguments.
55	 * @return the arguments passed to the invocation
56	 */
57	public ATTable base_getArguments() throws InterpreterException;
58	
59	/**
60	 * Assigns the arguments of a first class method. 
61	 * @return nil
62	 */
63	public ATNil base_setArguments(ATTable arguments) throws InterpreterException;
64	
65	/**
66	 * Sends this message to a particular receiver object. The way in which the message
67	 * send will be performed (synchronous or asynchronous) depends on the kind of message.
68	 * 
69	 * @param receiver the object receiving the message denoted by this ATMessage.
70	 * @param sender the object sending the message.denoted by this ATMessage
71	 * @return the value of the method invocation or message send.
72	 * @throws InterpreterException if the method is not found or an error occurs while processing the method.
73	 */
74	public ATObject base_sendTo(ATObject receiver, ATObject sender) throws InterpreterException;
75	
76	/**
77	 * Primitive implementation of base_sendTo.
78	 * @param self the AmbientTalk object to which 'sendTo' was originally sent
79	 */
80	public ATObject prim_sendTo(ATMessage self, ATObject receiver, ATObject sender) throws InterpreterException;
81
82}