| About Terracotta Documentation This documentation is about Terracotta DSO, an advanced distributed-computing technology aimed at meeting special clustering requirements. Terracotta products without the overhead and complexity of DSO meet the needs of almost all use cases and clustering requirements. To learn how to migrate from Terracotta DSO to standard Terracotta products, see Migrating From Terracotta DSO. To find documentation on non-DSO (standard) Terracotta products, see the Terracotta Documentation. Terracotta release information, such as release notes and platform compatibility, is found in Product Information. |
|
AspectWerkz Pattern LanguageAspectWerkz supports a fine-grained pattern language for selecting join points. This is useful in Terracotta XML configuration elements in which a number of related abstractions must be selected. Instead of explicitly naming each member of the classes, methods, or fields required, an AspectWerkz pattern can be used in the configuration element to cover sets of related abstractions. WildcardsYou can utilize two types of wildcards when constructing your patterns: * - which is used as a regular wildcard. Matches for example only one package level or one method parameter. When used to match a package name, matches at least one character. Else match zero or more character. .. - used either to match any sequence of characters that start and end with a "." (so it can be used to pick out all types in any subpackage) or in method selectors to match as many parameters as possible. For example org.codehaus..* will match all classes in all subpackages starting from org.codehaus. * method(..) will match all methods with any number of parameters. Another specific character to express inheritance based matching will be presented further. Combining the patternsThe patterns normally consists of a combination of a class and a method pattern or a class and a field pattern. Example of a full method pattern: <annotations> <modifiers> <return_type_pattern> <package_and_class_pattern>.<method_name_pattern>(<parameter_type_patterns>) Example of a full field pattern: <annotations> <modifiers> <field_type_pattern> <package_and_class_pattern>.<field_name_pattern> Example of a full class pattern: <annotations> <modifiers> <package_and_class_pattern> Class selectionsThe classes are selected by specifying a pattern that consists of:
All class patterns must follow this structure: <annotations> <modifiers> <full_class_name> For the class selections specify the full package name of the class along with some wildcards. Examplesfoo.bar.*
foo.*.FooBar
foo.*.FooB*
public foo.bar.*
@Session foo.bar.*
foo..
Method selectionsThe methods are selected by specifying a pattern that consists of:
All method patterns must follow this structure: <annotations> <modifiers> <return_type> <full_method_name>(<parameter_types>) Examplesint foo.*.Bar.method()
int *.method(*)
* method(..)
int foo.*.*.method(*,int)
int foo.*.Bar.method(..)
int foo.*.Bar.method(int,..)
int foo.*.Bar.method(java.lang.*)
int foo.*.Bar.me*o*()
* foo.*.Bar.method()
java.lang.* foo.*.Bar.method()
static int foo.*.Bar.method()
@Transaction * foo.*.*.*(..)
Constructor selectionsThe constructors are selected by specifying a pattern that consists of:
All the patterns must follow this structure: <annotations> <modifiers> <className>.new(<parameter_types>)
Examplesfoo.*.Bar.new()
* new(..)
*.new(String)
Field selectionsFields are selected by specifying a pattern that consists of:
All field patterns must follow this structure: <annotations> <modifiers> <field_type> <full_field_name>
Examplesint foo.*.Bar.m_foo
* m_field
* foo.*.Bar.m_foo
java.lang.* foo.*.Bar.m_foo
int foo.*.Bar.m_*
int foo.*.Bar.m_*oo*
Subtype patternsIt is possible to pick out all subtypes of a type with the "+" wildcard. The "+" wildcard immediately follows a type name pattern. The following picks out all method-call join points where an instance of exactly type Bar is constructed: * foo.Bar.*(..) The following picks out all method-call join points where an instance of any subtype of Bar (including Bar itself) is constructed: * foo.Bar+.*(..) Note that foo.Bar can be a class (including a super class) or an interface. Array type patternsA type name pattern or subtype pattern can be followed by one or more sets of square brackets to make array type patterns. So java.lang.Object[] is an array type pattern, and so is foo.bar.*[][]. AbbreviationsWhen picking out the return and parameter types it is possible to use predefined abbreviations for the classes in the java.lang.* and java.util.* packages. If you specify only the class name it will be mapped to the full class name for the class (you cannot use patterns in abbreviations). Abbreviations are supported for array types as well, with a dimension less or equal to 2. String[][] will thus be resolved as java.lang.String[][] but String[][][] will not. This is usefull when dealing with complex advice signature in the XML definition. ExamplesYou can use:
Apart from these abbreviations you always have to specify the fully qualified name of the class (along with the wildcards). |