public class MetricsCollectingMarshaller<T> extends Object implements Marshaller<T>
Marshaller
which delegates to another marshaller, whilst collecting metrics about the execution and
streaming of that delegate.
Metrics will onlty be collected if the executiuon and streaming do not throw exceptions. Exception conditions are likely to skew the metrics, and so will not be recorded.
Modifier and Type | Method and Description |
---|---|
static <T> Marshaller<T> |
forMarshaller(MarshallerMetricsCollector metricsCollector,
Marshaller<T> marshaller)
Creates an instrumented wrapper around another Marshaller which will gather execution metrics
|
Streamable |
marshal(T object,
ConversionContext conversionContext)
Marshals an object to XML.
|
@Nonnull public static <T> Marshaller<T> forMarshaller(MarshallerMetricsCollector metricsCollector, Marshaller<T> marshaller)
T
- The type of the values being marshalledmetricsCollector
- The collector to usemarshaller
- The marshaller to be instrumentedpublic Streamable marshal(T object, @Nullable ConversionContext conversionContext) throws XhtmlException
Marshaller
marshal
in interface Marshaller<T>
object
- object to marshalconversionContext
- the conversion contextXhtmlException
- if an error occurs during marshallingCopyright © 2003–2016 Atlassian. All rights reserved.