public interface MutableTopic extends Topic
Destination
, Subscription
or a Topic
.
A MutableTopic
can be used in any method that takes either a Destination
,
Subscription
or Topic
as an argument. A MutableTopic may not be changed while
inside an API call which means that MutableTopics are not thread safe. However, a MutableTopic
may be re-used/changed at any other time. A MutableTopic cannot be temporary. In order to modify
the contents, applications must call flip() or reset() on the byteBuffer, add content, then call
flip() to set the position to the beginning of the topic and the limit to the end of the topic
before passing the MutableTopic to any API that requires a Topic parameter. Calling Destination.getName()
on a MutableTopic will always return null.
MutableTopics must be created by using this Allocator:
NOTE: to avoid garbage collection, applications should not allocate a new MutableTopic for every use case. Instead applications should maintain as many MutableTopics as necessary in a pool and re-use them when needed.Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
getNameBuffer()
Retrieves the reference of the nameBuffer in order to allow applications to modify contents of the nameBuffer directly.
|
getName, isTemporary
Copyright 2004-2024 Solace Corporation. All rights reserved.