@ComponentProfile(summary="Serializer specifically used to create a human readable representation of a metric timeslice.", tag="marshaller") public class StatisticMarshaller extends AbstractMarshaller
This marshaller is designed for InterceptorStatistic
and is used exclusively with the ProducingStatisticManager
.
We convert the InterceptorStatistic
into a SerializableStatistic
and then use the configured XStream marshaller to serialize the object.
The defauilt XStream marshaller is for XML, but you can configure the JSON version by setting the property "actual-marshaller".
AbstractMarshaller.Deserializer, AbstractMarshaller.Serializer
AdaptrisMarshaller.MarshalInputStream, AdaptrisMarshaller.MarshalOutputStream
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log |
Constructor and Description |
---|
StatisticMarshaller() |
Modifier and Type | Method and Description |
---|---|
AdaptrisMarshaller |
getActualMarshaller() |
java.lang.String |
marshal(java.lang.Object obj)
Marshalls an object to XML.
|
void |
marshal(java.lang.Object obj,
java.io.Writer writer)
Marshalls an object to XML.
|
void |
setActualMarshaller(AdaptrisMarshaller actualMarshaller) |
java.lang.Object |
unmarshal(java.io.Reader reader)
Unmarshalls an
Object based on the passed Reader . |
invokeDeserialize, invokeSerialize, marshal, marshal, marshal, marshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
uncheckedMarshal, uncheckedUnmarshal
public java.lang.String marshal(java.lang.Object obj) throws CoreException
AdaptrisMarshaller
obj
- the Object
to marshall to XMLObject
CoreException
- wrapping any underlying Exception
public void marshal(java.lang.Object obj, java.io.Writer writer) throws CoreException
AdaptrisMarshaller
obj
- the Object
to marshall to XMLwriter
- the writer to write toCoreException
- wrapping any underlying Exception
public java.lang.Object unmarshal(java.io.Reader reader) throws CoreException
AdaptrisMarshaller
Unmarshalls an Object
based on the passed Reader
.
reader
- a Reader
with XML to unmarshalObject
CoreException
- wrapping any underlying Exception
public AdaptrisMarshaller getActualMarshaller()
public void setActualMarshaller(AdaptrisMarshaller actualMarshaller)