public interface TopicLoader
TopicProvider
.
One or more Topic Loaders may be added to a TopicProvider using
TopicProvider.addTopicLoader(TopicLoader, String)
which indicates the
topic(s) that the loader applies to.
This can be used to create a separate loader class or simply for declaring an anonymous class within the TopicProvider.
For example:
addTopicLoader(
new TopicLoader() {
load(TopicClient client,Topic topic)
throws APIException {
TopicMessage message = topic.createLoadMessage();
message.put("Some Data");
client.send(message);
}
},
"MyTopic");
Note that the above example could be achieved more simply by using
SimpleTopicLoader
. This basic TopicLoader interface would typically
be used for more specialised processing.
Since version 5.5, topic loaders are only called for
stateless
topics.
Modifier and Type | Method and Description |
---|---|
boolean |
load(TopicClient client,
Topic topic)
This is used to perform the Topic Load processing for a Client when
requested.
|
boolean load(TopicClient client, Topic topic) throws APIException
client
- the Client that has requested the load.topic
- the Topic that the load relates to.APIException
- if unable to perform the Topic load processing.Copyright © 2016 Push Technology Ltd. All Rights Reserved.