org.springframework.core
Class ControlFlowFactory.Jdk13ControlFlow

java.lang.Object
  extended by org.springframework.core.ControlFlowFactory.Jdk13ControlFlow
All Implemented Interfaces:
ControlFlow
Enclosing class:
ControlFlowFactory

static class ControlFlowFactory.Jdk13ControlFlow
extends Object
implements ControlFlow

Java 1.3 version of utilities for cflow-style pointcuts. We can't rely on the Java 1.4 StackTraceElement class.

Note that such pointcuts are 10-15 times more expensive to evaluate under JDK 1.3 than other pointcuts, as they require analysis of the stack trace (through constructing a new throwable). However, they are useful in some cases.


Constructor Summary
ControlFlowFactory.Jdk13ControlFlow()
           
 
Method Summary
 boolean under(Class clazz)
          Searches for class name match in the stringified stacktrace.
 boolean under(Class clazz, String methodName)
          Searches for class name + "." + method name match in the stringified stacktrace.
 boolean underToken(String token)
          Leave it up to the caller to decide what matches.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControlFlowFactory.Jdk13ControlFlow

public ControlFlowFactory.Jdk13ControlFlow()
Method Detail

under

public boolean under(Class clazz)
Searches for class name match in the stringified stacktrace.

Specified by:
under in interface ControlFlow
Parameters:
clazz - the clazz to look for

under

public boolean under(Class clazz,
                     String methodName)
Searches for class name + "." + method name match in the stringified stacktrace. Checks the character right after the method name for '(' or whitespace, to only match the exact method name (and not a method with a longer name that happens to start with the same characters).

The whitespace check has been introduced for compatibility with GNU ClassPath, as of Spring 1.2.7. Sun JDKs (and JDKs with licensed Sun core libraries) always append '(' right after the method name.

Specified by:
under in interface ControlFlow
Parameters:
clazz - the clazz to look for
methodName - the name of the method to look for

underToken

public boolean underToken(String token)
Leave it up to the caller to decide what matches. Caller must understand stack trace format, so there's less abstraction.

Specified by:
underToken in interface ControlFlow
Parameters:
token - the token to look for


Copyright (c) 2002-2007 The Spring Framework Project.