com.neeve.sma
Class MessageBusBindingFactory

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.sma.SmaObject
          extended by com.neeve.sma.MessageBusBindingFactory

public final class MessageBusBindingFactory
extends SmaObject

The message bus binding factory.

The message bus binding factory, a singleton object, provides methods to create message bus bindings.

Threading:
The message bus binding factory is not safe for concurrent access by multiple threads.

Method Summary
 MessageBusBinding createBinding(String userName, MessageBusDescriptor descriptor, IEventHandler eventHandler)
          Bind to a message bus using a bus descriptor.
 MessageBusBinding createBinding(String userName, String busName, IEventHandler eventHandler)
          Bind to a message bus using a bus name.
static MessageChannel.RawKeyResolutionTable createRawKeyResolutionTable()
          Creates a MessageChannel.RawKeyResolutionTable.
static MessageBusBindingFactory getInstance()
          Get the singleton message bus binding factory instance.
 
Methods inherited from class com.neeve.root.RootObject
getChecked, getThreaded, getTracer, setChecked, setTracer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final MessageBusBindingFactory getInstance()
Get the singleton message bus binding factory instance.

Threading:
This method is safe for concurrent access by multiple threads.

createBinding

public final MessageBusBinding createBinding(String userName,
                                             MessageBusDescriptor descriptor,
                                             IEventHandler eventHandler)
                                      throws SmaException
Bind to a message bus using a bus descriptor.

Parameters:
userName - The name of the user creating this binding.
descriptor - The descriptor describing the bus to bind to.
eventHandler - The event handler to be used by the created binding to dispatch its events.
Throws:
SmaException - Thrown in case an error occurs during the creation of the binding. The throwing of this exception implies that the exception could be caused by a temporary condition and that caller can retry the binding creation
SmaPermanentException - Thrown in case an error occurs during the creation of the binding caused by a permanent condition. The throwing of this exception implies that there is no reason for the binding creation to be reattempted since it will always fail.
Threading:
This method is not safe for concurrent access by multiple threads.

createBinding

public final MessageBusBinding createBinding(String userName,
                                             String busName,
                                             IEventHandler eventHandler)
                                      throws SmaException
Bind to a message bus using a bus name.

Parameters:
userName - The name of the user creating this binding.
busName - The name of the bus to bind to.
eventHandler - The event handler to be used by the created binding to dispatch its events.
Throws:
SmaException - Thrown in case an error occurs during the creation of the binding.
Threading:
This method is not safe for concurrent access by multiple threads.

This method creates a message bus binding using a bus identified by name. The method first creates a bus descriptor from property files using the MessageBusDescriptor.load(com.neeve.config.IConfigRepository, java.lang.String, java.lang.String) method. It then creates the message bus binding using the created descriptor.


createRawKeyResolutionTable

public static final MessageChannel.RawKeyResolutionTable createRawKeyResolutionTable()
Creates a MessageChannel.RawKeyResolutionTable. A MessageChannel.RawKeyResolutionTable is used with MessageChannel.resolveMessageKeyToRaw(XString, MessageView, RawKeyResolutionTable) to resolve message keys without producing garbage.

Returns:
An empty MessageChannel.RawKeyResolutionTable


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