Class TimerDecorator
- java.lang.Object
-
- org.forgerock.openig.decoration.helper.AbstractDecorator
-
- org.forgerock.openig.decoration.helper.AbstractHandlerAndFilterDecorator
-
- org.forgerock.openig.decoration.timer.TimerDecorator
-
- All Implemented Interfaces:
Decorator
public class TimerDecorator extends AbstractHandlerAndFilterDecorator
The timer decorator can decorate bothFilter
andHandler
instances. It will log elapsed time within the decorated heap object.It has to be declared inside of the heap objects section:
{ "name": "myTimerDecorator", "type": "TimerDecorator" }
If you want to specify the time unit:
{ "name": "myTimerDecorator", "type": "TimerDecorator" "config": { "timeUnit": "ms" } }
Duration
. An invalid string or non recognized time unit will throw an error.To decorate a component, just add the decorator declaration next to the
config
element:{ "type": "...", "timer": true, "config": { ... } }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TimerDecorator.Heaplet
Creates and initializes a TimerDecorator in a heap environment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DecorationHandle
decorateFilter(Filter delegate, JsonValue decoratorConfig, Context context)
protected DecorationHandle
decorateHandler(Handler delegate, JsonValue decoratorConfig, Context context)
-
Methods inherited from class org.forgerock.openig.decoration.helper.AbstractHandlerAndFilterDecorator
accepts, decorate
-
Methods inherited from class org.forgerock.openig.decoration.helper.AbstractDecorator
getLogger
-
-
-
-
Method Detail
-
decorateFilter
protected DecorationHandle decorateFilter(Filter delegate, JsonValue decoratorConfig, Context context) throws HeapException
Description copied from class:AbstractHandlerAndFilterDecorator
- Specified by:
decorateFilter
in classAbstractHandlerAndFilterDecorator
- Parameters:
delegate
- Filter instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instance- Returns:
- a handle to the decoration
- Throws:
HeapException
- when decoration fails
-
decorateHandler
protected DecorationHandle decorateHandler(Handler delegate, JsonValue decoratorConfig, Context context) throws HeapException
Description copied from class:AbstractHandlerAndFilterDecorator
- Specified by:
decorateHandler
in classAbstractHandlerAndFilterDecorator
- Parameters:
delegate
- Handler instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instance- Returns:
- a handle to the decoration
- Throws:
HeapException
- when decoration fails
-
-