public abstract class ResourceAwareMessageFormat<T> extends Object implements XMessageFormat<T>
XMessageFormat
to support
resource awareness for a payload format which gives the ability
to clean up the underlying resources(e.g : file) at the end of
the life cycle of attached XMessage
Constructor and Description |
---|
ResourceAwareMessageFormat() |
Modifier and Type | Method and Description |
---|---|
XMessageFormat<T> |
copyOf()
Clones the message format possibly cloning the payload within this format, if an implementation doesn't
support cloning it is expected that particular implementation to throw an
UnsupportedOperationException |
protected abstract XMessageFormat<T> |
getCopyOf()
Actual implementation of copying should do in the
implementation of this abstract method
|
boolean |
isAttachedToAMessage() |
void |
markAsAttachedToaMessage()
When invoked change
attachedToAMessage value to true,
This ensures releasing this XMessageFormat's resources has been
delegated to the message lifecycle |
protected abstract void |
releaseBackingResource()
Actual implementation of release resources should
do in the implementation of this abstract method.
|
void |
releaseResources()
Used to clear the underlying resources when such cleaning needed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
readAsNative, readAsStream, readAsString, size, writeTo
public void markAsAttachedToaMessage()
attachedToAMessage
value to true,
This ensures releasing this XMessageFormat's resources has been
delegated to the message lifecyclemarkAsAttachedToaMessage
in interface XMessageFormat<T>
public final XMessageFormat<T> copyOf()
UnsupportedOperationException
copyOf
in interface XMessageFormat<T>
public final void releaseResources()
releaseResources
in interface XMessageFormat<T>
protected abstract XMessageFormat<T> getCopyOf()
protected abstract void releaseBackingResource()
public boolean isAttachedToAMessage()
Copyright © 2016–2019 AdroitLogic. All rights reserved.