Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (65 sloc) 2.24 KB
#######################################################################
# JBoss, Home of Professional Open Source
# Copyright 2011, Red Hat and individual contributors as identified
# by the @authors tag. See the copyright.txt in the distribution for a
# full listing of individual contributors.
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this software; if not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
#
# @authors Andrew Dinn
#
# A rule which dumps the text passed to a CharSequenceSource when it is created
RULE trace input characters
CLASS CharSequenceSource
METHOD <init>(CharSequence)
AT EXIT
IF TRUE
DO traceln("#INPUT\n" + $1.toString() + "#END")
ENDRULE
# A rule which dumps the text stored in a CharSequenceSink when it is retreived
RULE trace output characters
CLASS CharSequenceSink
METHOD toString()
AT EXIT
IF TRUE
DO traceln("#OUTPUT\n" + $! + "#END")
ENDRULE
# A rule which traces replacements made by a PatternReplacer
# if the returned line of text differs from the input line it
# is dumped to System.out
RULE dump pattern transformed text
CLASS PatternReplacer
METHOD transform(String)
AT EXIT
IF NOT $1.equals($!)
DO traceln(" patternReplace(" + $1 + " -> " + $! +")")
ENDRULE
# A rule which prints a trace message whenever a thread's run method is entered
RULE trace Thread.run entry
CLASS ^Thread
METHOD run()
AT ENTRY
IF TRUE
DO traceln("entered run for " + $this.getClass().getName());
ENDRULE
# A rule which prints a trace message whenever a thread's run method is exited
RULE trace Thread.run exit
CLASS ^Thread
METHOD run()
AT EXIT
IF TRUE
DO traceln("exited run for " + $this.getClass().getName());
ENDRULE
You can’t perform that action at this time.