Changeset 4550 for trunk/manuals

Show
Ignore:
Timestamp:
10/31/08 09:44:36 (2 months ago)
Author:
pmoura
Message:

Modified the implementation of the built-in method define_events/5 to throw an exception when the monitor object doesn't define the required event handler methods (previously the define_events/5 call would simply fail).

Location:
trunk/manuals
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/manuals/index.html

    r4549 r4550  
    3232    <div class="copyright"> 
    3333        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    34         <span>Last updated on: October 30, 2008</span> 
     34        <span>Last updated on: October 31, 2008</span> 
    3535    </div> 
    3636    <div class="navbottom"> 
  • trunk/manuals/refman/builtins/define_events5.html

    r3957 r4550  
    2626<pre>define_events(Event, Object, Message, Sender, Monitor)</pre> 
    2727<p> 
    28 Defines a new set of events. The two types of events are represented by the atoms <code>before</code> and <code>after</code>. 
     28Defines a new set of events. The two types of events are represented by the atoms <code>before</code> and <code>after</code> The object <code>Monitor</code> must define the event handler methods required by the <code>Event</code> argument. 
    2929</p> 
    3030 
     
    4848    <dt>Monitor is neither a variable nor a valid object identifier:</dt> 
    4949        <dd><code>existence_error(object_identifier, Monitor)</code></dd> 
     50    <dt>Monitor does not define the required <code>before/3</code> method:</dt> 
     51        <dd><code>existence_error(procedure, before/3)</code></dd> 
     52    <dt>Monitor does not define the required <code>after/3</code> method:</dt> 
     53        <dd><code>existence_error(procedure, after/3)</code></dd> 
    5054</dl> 
    5155 
     
    5761    <div class="copyright"> 
    5862        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    59         <span>Last updated on: December 9, 2007</span> 
     63        <span>Last updated on: October 31, 2008</span> 
    6064    </div> 
    6165    <div class="navbottom"> 
  • trunk/manuals/refman/index.html

    r4537 r4550  
    321321    <div class="copyright"> 
    322322        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    323         <span>Last updated on: October 24, 2008</span> 
     323        <span>Last updated on: October 31, 2008</span> 
    324324    </div> 
    325325    <div class="navbottom"> 
  • trunk/manuals/refman/refman.header

    r4537 r4550  
    3636        <span>http://logtalk.org/</span> 
    3737    </p> 
    38     <p class="date">Last updated on October 24, 2008</p> 
     38    <p class="date">Last updated on October 31, 2008</p> 
    3939</div> 
    4040 
  • trunk/manuals/userman/events.html

    r4530 r4550  
    158158<pre>| ?- define_events(Event, Object, Message, Sender, Monitor).</pre> 
    159159<p> 
    160 Note that if any of the arguments is a free variable or contains free variables, this call will define the <strong>set</strong> of matching events. 
     160Note that if any of the <code>Event</code>, <code>Object</code>, <code>Message</code>, and <code>Sender</code> arguments is a free variable or contains free variables, this call will define the <strong>set</strong> of matching events. 
    161161</p> 
    162162 
     
    174174 
    175175<p> 
    176 The <code>monitoring</code> built-in protocol declares two public predicates, <a title="Consult reference manual" href="../refman/methods/before3.html"><code>before/3</code></a> and <a title="Consult reference manual" href="../refman/methods/after3.html"><code>after/3</code></a>, that are automatically called to handle <code>before</code> and <code>after</code> events. Any object that plays the role of monitor should define one or both of these event handler methods:  
     176The <code>monitoring</code> built-in protocol declares two public predicates, <a title="Consult reference manual" href="../refman/methods/before3.html"><code>before/3</code></a> and <a title="Consult reference manual" href="../refman/methods/after3.html"><code>after/3</code></a>, that are automatically called to handle <code>before</code> and <code>after</code> events. Any object that plays the role of monitor must define one or both of these event handler methods:  
    177177</p> 
    178178<pre>before(Object, Message, Sender) :- 
     
    184184The arguments in both methods are instantiated by the message sending mechanisms when a spied event occurs. For example, assume that we want to define a monitor called <code>tracer</code> that will track any message sent to an object by printing a describing text to the standard output. Its definition could be something like:</p> 
    185185<pre>:- object(tracer, 
    186     implements(monitoring)). 
     186    implements(monitoring)).    % built-in protocol for event handler methods 
    187187 
    188188    before(Object, Message, Sender) :- 
     
    248248    <div class="copyright"> 
    249249        <span>Copyright &copy; <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> &mdash; <a href="http://logtalk.org">Logtalk.org</a></span><br/>  
    250         <span>Last updated on: October 20, 2008</span> 
     250        <span>Last updated on: October 31, 2008</span> 
    251251    </div> 
    252252    <div class="navbottom"> 
  • trunk/manuals/userman/userman.header

    r4549 r4550  
    3636        <span>http://logtalk.org/</span> 
    3737    </p> 
    38     <p class="date">Last updated on October 30, 2008</p> 
     38    <p class="date">Last updated on October 31, 2008</p> 
    3939</div> 
    4040