Community
Participate
Working Groups
(originally from http://trac.objectteams.org/ot/ticket/184) Just to put this on our long-term radar. Besides basic method interception there are several cases where a constructor call needs to be intercepted by a callin directly. (comment:1) We need to carefully distinguish here: * after callins to a constructor are feasible with only some changes even in the current implementation, because the additional dispatch code can be inserted to the end of a constructor (about remaining differences / difficulties see below). * before and replace callins to a constructor would have to happen at the call site => not further investigating since we don't do call-site-weaving. Remaining difficulties for after: * We cannot use the pattern of initial-wrapper, orig-method, chaining- wrapper, because the original constructor cannot be renamed, and any chaining of constructors would need to happen before any additional code is executed. A probable solution: o inline the lookup of active teams (normally done in the initial wrapper) into the end of the constructor. o generate a chaining wrapper containing only calls to after callins. * It will have to be checked, whether this proposed pattern solves all issues of inheritance in the same way as the normal callin implementation does. --- (above descriptions partly updated wrt the original trac issue). Question: why would a chaining wrapper be needed when only calling after bindings?
Support for callin-after to constructor has been released for 2.2 RC1 via commit 12a20748e9e180d0cb9ed70d2f88cf8f1c309085. A first application can already be found in the fix for bug 408460.
Verified for 2.2 using build 201306040500