Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.hivemind.methodmatch
Class MethodMatcher  view MethodMatcher download MethodMatcher.java

java.lang.Object
  extended byorg.apache.hivemind.methodmatch.MethodMatcher

public class MethodMatcher
extends java.lang.Object

A utility class used for matching a org.apache.hivemind.service.MethodSignature against a method pattern (this is primarily used by interceptor factories). A method pattern consists of a name pattern and an optional parameters pattern.

The name pattern matches against the method name, and can be one of the following:

The parameters pattern follows the name pattern and is optional. It is used to check the number of parameters, or their types. When the parameters pattern is omitted, then the number and types of parameters are not considred when matching methods.

The parameters pattern, when present, is contained within open and closed parenthis after the method pattern. Inside the parenthesis may be a number, indicating the exact number of method parameters to match against. Alternately, a comma-seperated list of Java types is used, which matches against a method that takes the exact set of parameters. Examples:


Nested Class Summary
private  class MethodMatcher.StoredPattern
           
 
Field Summary
private  java.lang.Object _defaultValue
           
private  java.util.List _methodInfos
           
private  MethodPatternParser _parser
           
 
Constructor Summary
MethodMatcher()
           
MethodMatcher(java.lang.Object defaultValue)
          Constructor that takes a default value returned when no stored method pattern matches the input to get(MethodSignature) 55 .
 
Method Summary
 java.lang.Object get(org.apache.hivemind.service.MethodSignature sig)
          Returns a pattern value prevoiusly stored via put(String, Object) 55 .
private  MethodFilter parseMethodPattern(java.lang.String pattern)
           
 void put(java.lang.String methodPattern, java.lang.Object patternValue)
          Stores a pattern and an associated value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_parser

private MethodPatternParser _parser

_methodInfos

private java.util.List _methodInfos

_defaultValue

private java.lang.Object _defaultValue
Constructor Detail

MethodMatcher

public MethodMatcher(java.lang.Object defaultValue)
Constructor that takes a default value returned when no stored method pattern matches the input to get(MethodSignature) 55 .

Since:
1.1

MethodMatcher

public MethodMatcher()
Method Detail

parseMethodPattern

private MethodFilter parseMethodPattern(java.lang.String pattern)

put

public void put(java.lang.String methodPattern,
                java.lang.Object patternValue)
Stores a pattern and an associated value. Values can later be accessed via get(MethodSignature) 55 .


get

public java.lang.Object get(org.apache.hivemind.service.MethodSignature sig)
Returns a pattern value prevoiusly stored via put(String, Object) 55 . Iterates over the patterns stored, in the order in which they were stored, until a match is found.