com.neeve.toa.spi
Interface TopicResolver<T extends MessageView>

All Known Implementing Classes:
AbstractTopicResolver

public interface TopicResolver<T extends MessageView>

A TopicResolver resolves a channel key for a message being sent on a given channel.

Threading

TopicResolvers are NOT and their methods are not safe for concurrent access by multiple threads.


Method Summary
 void initialize(ToaServiceChannel serviceChannel)
          Will be called by TopicOrientedApplication at startup to initialize the channel key.
 XString resolveTopic(T message, MessageChannel.RawKeyResolutionTable krt)
          Resolves the topic for the given MessageView.
 XString resolveTopic(T message, Properties krt)
          Resolves the topic for the given MessageView.
 

Method Detail

initialize

void initialize(ToaServiceChannel serviceChannel)
Will be called by TopicOrientedApplication at startup to initialize the channel key.

Note that at the time this method is called, TopicOrientedApplication will have set the initial key resolution table via ToaServiceChannel.getInitialKRT().

Variable components of the channel key provided by an ChannelInitialKeyResolutionTableProvider will already have been substituted in the key set in the serviceChannel.


resolveTopic

XString resolveTopic(T message,
                     MessageChannel.RawKeyResolutionTable krt)
                     throws Exception
Resolves the topic for the given MessageView.

This key resolution method is intended for low latency applications. As such implementors of this method should not produce garbage.

This variant of key resolution can be faster since than resolveTopic(MessageView, Properties) because the values in a MessageChannel.RawKeyResolutionTable can be preserialized and thus don't require character encoding.

Parameters:
message - The message for which to resolve the topic.
krt - The MessageChannel.RawKeyResolutionTable.
Returns:
The resolved topic.
Throws:
Exception - If the key can't be resolved completely this method must thrown an Exception.
Threading:
This method is not safe for concurrent access by multiple threads.

resolveTopic

XString resolveTopic(T message,
                     Properties krt)
                     throws Exception
Resolves the topic for the given MessageView.

Parameters:
message - The message for which to resolve the topic.
Returns:
The resolved topic.
Throws:
Exception - If the key can't be resolved completely this method must thrown an Exception.
Threading:
This method is not safe for concurrent access by multiple threads.


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.