public class ThreadLocalMimeBodyPartRecorder extends Object implements MimeBodyPartRecorder
ThreadLocal
to keep track of embeddable images.
A single instance can be distributed amongst the application under the downside of having to track in the same thread as the caller of record.
If the log level is set to debug, this implementation will perform a check for binary equality of
DataSources
with the same name.
Constructor and Description |
---|
ThreadLocalMimeBodyPartRecorder() |
Modifier and Type | Method and Description |
---|---|
boolean |
isRecording() |
<T> com.atlassian.fugue.Pair<com.atlassian.fugue.Maybe<T>,Iterable<MimeBodyPartReference>> |
record(Callable<T> callback)
Activate the recorder so that it can record
MimeBodyPartRecorder.track(javax.activation.DataSource) calls. |
com.atlassian.fugue.Maybe<MimeBodyPartReference> |
track(DataSource source)
Track the given image source.
|
public <T> com.atlassian.fugue.Pair<com.atlassian.fugue.Maybe<T>,Iterable<MimeBodyPartReference>> record(Callable<T> callback) throws Exception
MimeBodyPartRecorder
MimeBodyPartRecorder.track(javax.activation.DataSource)
calls.record
in interface MimeBodyPartRecorder
T
- the return type of the callbackcallback
- the code eligible for recordingException
- if the callback escapespublic boolean isRecording()
isRecording
in interface MimeBodyPartRecorder
public com.atlassian.fugue.Maybe<MimeBodyPartReference> track(DataSource source)
MimeBodyPartRecorder
track
in interface MimeBodyPartRecorder
source
- a DataSource
encapsulating the access to the image dataCopyright © 2003–2017 Atlassian. All rights reserved.