All pages
Powered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

HibernateTransaction

This aspect is a self-binding aspect that will surround methods with native Hibernate transaction blocks.

ClassMatcher

MethodMatcher

any

annotatedWith:transactional

To use, just declare in your binder, overriding the self-binding is totally optional.

mapAspect("CFTransaction").to("coldbox.system.aop.aspects.HibernateTransaction");

MethodLogger

This aspect enables you to log method calls and their results. You will have to bind it to the methods you want it to listen to. It has one constructor argument:

Name

Type

Required

Default

Description

logResults

boolean

false

true

Whether to log the results of method calls or not.

// Map the Aspect
mapAspect("MethodLogger")
    .to("coldbox.system.aop.aspects.MethodLogger")
    .initArg(name="logResults",value="true or false");

// Bind the Aspect to all service class methods
bindAspect(classes=matcher().regex('.*Service'), methods=matcher().any(), aspects="MethodLogger");

Included Aspects

WireBox comes bundled with three aspects that you can use in your applications and can be found in wirebox.system.aop.aspects:

Aspect

Description

CFTransaction

A simple ColdFusion transaction Aspect for WireBox

HibernateTransaction

A cool annotation based Transaction Aspect for WireBox

MethodLogger

A simple interceptor that logs method calls and their results

CFTransaction

This aspect is a self-binding aspect that will surround methods with simple ColdFusion transaction blocks.

ClassMatcher

MethodMatcher

any

annotatedWith:transactional

To use, just declare in your binder, overriding the self-binding is totally optional.

mapAspect("CFTransaction").to("coldbox.system.aop.aspects.CFTransaction");