Package com.wavefront.agent.queueing
Interface TaskConverter<T>
-
- Type Parameters:
T
- type of objects stored.
- All Known Implementing Classes:
RetryTaskConverter
public interface TaskConverter<T>
Proxy-specific interface for converting data into and from queues, this potentially allows us to support other converting mechanisms in the future.- Author:
- [email protected]
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TaskConverter.CompressionType
Supported compression schemas
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
fromBytes(byte[] bytes)
De-serializes an object from a byte array.Integer
getWeight(byte[] bytes)
Attempts to retrieve task weight from abyte[]
, without de-serializing the object, if at all possible.void
serializeToStream(T value, OutputStream bytes)
Serializesvalue
to bytes written to the specified stream.
-
-
-
Method Detail
-
fromBytes
T fromBytes(@Nonnull byte[] bytes) throws IOException
De-serializes an object from a byte array.- Returns:
- de-serialized object.
- Throws:
IOException
-
serializeToStream
void serializeToStream(@Nonnull T value, @Nonnull OutputStream bytes) throws IOException
Serializesvalue
to bytes written to the specified stream.- Parameters:
value
- value to serialize.bytes
- output stream to write abyte[]
to.- Throws:
IOException
-
-