You can use User Defined Function (UDF). A UDF is defined on a view model, and implementation is provided through Java code. See https://docs.jboss.org/author/display/TEIID/User+Defined+Functions
When you define the function like "test123" on the translator it is called "source or pushdown" function, it upto the translator to handle it in translator layer or really push down to source for evaluation. Look the ExecutionFactory class's "addPushDownFunction" method. Also, when the query is passed to translator for evaluation, you need to provide hooks to evaluate and return right results.
We hook into Java either through a translator or a UDF. You're choice would mostly be about calling style, function/procedure/table abstraction. If you don't need a result set and only have in parameters then you can use function.
Thanks Steve and Ramesh. I want to do something with the results of continuous execution (fire some actions based on conditions). I think calling UDF from trigger is exactly what I need.