Package com.storedobject.core
Class StreamContentProducer
java.lang.Object
com.storedobject.core.StreamContentProducer
- All Implemented Interfaces:
Executable
,ContentProducer
,ContentType
,RequiresTransactionManager
,Closeable
,AutoCloseable
,Runnable
- Direct Known Subclasses:
AbstractSpreadSheet
,ImageProducer
,TextContentProducer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method may be called when the content generation is aborted due to some error.void
close()
abstract void
Generate the content here and write to 'out'final Entity
getError()
Get the current error (set viaContentProducer.abort(Throwable)
).final ReportFormat
Retrieves the transaction manager associated with this object.protected Writer
static boolean
isBlocked
(ContentProducer contentProducer, String type) final boolean
void
produce()
Produce the content.void
ready()
void
Sets the transaction manager for this object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.storedobject.core.ContentProducer
execute, extractContent, getFileExtension, getStreamData, getStreamDataProvider, getSystemEntity, saveTo, saveTo, saveTo, saveTo
Methods inherited from interface com.storedobject.core.ContentType
getContentType, getLink, getMimeType, isAudio, isHTML, isImage, isLink, isMedia, isPDF, isText, isVideo
Methods inherited from interface com.storedobject.common.Executable
act, run
-
Field Details
-
out
-
entity
-
-
Constructor Details
-
StreamContentProducer
public StreamContentProducer() -
StreamContentProducer
-
-
Method Details
-
produce
public void produce()Description copied from interface:ContentProducer
Produce the content.- Specified by:
produce
in interfaceContentProducer
-
ready
public void ready()- Specified by:
ready
in interfaceContentProducer
-
getFileName
- Specified by:
getFileName
in interfaceContentProducer
-
generateContent
-
getContent
- Specified by:
getContent
in interfaceContentProducer
-
setTransactionManager
Description copied from interface:RequiresTransactionManager
Sets the transaction manager for this object. The transaction manager is responsible for managing transaction boundaries.- Specified by:
setTransactionManager
in interfaceRequiresTransactionManager
- Parameters:
tm
- the transaction manager to be set
-
getTransactionManager
Description copied from interface:RequiresTransactionManager
Retrieves the transaction manager associated with this object.- Specified by:
getTransactionManager
in interfaceContentProducer
- Specified by:
getTransactionManager
in interfaceRequiresTransactionManager
- Returns:
- the transaction manager responsible for managing transaction boundaries
-
getWriter
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
abort
Description copied from interface:ContentProducer
This method may be called when the content generation is aborted due to some error.Note: This could be invoked multiple times.
- Specified by:
abort
in interfaceContentProducer
- Parameters:
error
- Error.
-
getError
Description copied from interface:ContentProducer
Get the current error (set viaContentProducer.abort(Throwable)
).- Specified by:
getError
in interfaceContentProducer
- Returns:
- Current error if any.
-
getReportFormat
-
getEntity
- Specified by:
getEntity
in interfaceContentProducer
-
isBlocked
-
isBlocked
-