com.neeve.sma
Class MessageViewFactoryRegistry

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

public final class MessageViewFactoryRegistry
extends SmaObject

The message view factory registry.

The view factory registry, a singleton class, stores references to configured message view factories. It loads and instantiates view factories and serves them out by name and id.

Threading:
The view factory registry is safe for concurrent access by multiple threads.

Field Summary
static String ADM_COMPATIBILITY_LEVEL
          The SMA ADM Generated Code Compatibility level.
 
Method Summary
 void dumpFactoryVersionInfo(StringBuilder builder)
          Dump the registered factories' version information.
static MessageViewFactoryRegistry getInstance()
          Get the singleton view factory registry instance.
 MessageViewFactory getMessageViewFactory(short factoryId)
          Get a view factory.
 Set<String> getMessageViewFactoryNames(Set<String> factories)
          Get the names of the set of registered factories.
static MessageViewFactory loadViewFactory(String className)
          Load (instantiate) a message view factory class
 boolean registerIfNoConflict(MessageViewFactory factory)
          Registers the given factory, if it doesn't conflict with an existing factory.
 boolean registerIfNoConflict(String factoryClassName)
          Register a message view factory by class name, if it doesn't conflict with an existing factory.
 void registerMessageViewFactory(MessageViewFactory factory)
          Register a message view factory.
 void registerMessageViewFactory(String factoryClassName)
          Register a message view factory by class name.
 
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
 

Field Detail

ADM_COMPATIBILITY_LEVEL

public static final String ADM_COMPATIBILITY_LEVEL
The SMA ADM Generated Code Compatibility level.

See Also:
Constant Field Values
Method Detail

getInstance

public static final MessageViewFactoryRegistry getInstance()
Get the singleton view factory registry instance.

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

loadViewFactory

public static final MessageViewFactory loadViewFactory(String className)
                                                throws Exception
Load (instantiate) a message view factory class

Parameters:
className - The name of the view factory class to instantiate
Throws:
Exception

registerMessageViewFactory

public final void registerMessageViewFactory(String factoryClassName)
                                      throws Exception
Register a message view factory by class name.

Parameters:
factoryClassName - The class name of the message factory to register
Throws:
EAdmCompatibilityException - If the factory is not compatible with the runtime
Exception
Threading:
This method is safe for concurrent access by multiple threads.

This method instantiates a message factory of the supplied class name and adds the instantiated factory to the view factory registry. It will replace a factory of the same id if one exists.


registerMessageViewFactory

public final void registerMessageViewFactory(MessageViewFactory factory)
Register a message view factory.

Parameters:
factory - The message factory to register
Throws:
EAdmCompatibilityException - If the factory is not compatible with the runtime
Threading:
This method is safe for concurrent access by multiple threads.

This method adds the supplied message view factory to the view factory registry. It will replace a factory of the same id if one exists.


registerIfNoConflict

public final boolean registerIfNoConflict(String factoryClassName)
                                   throws SmaFactoryIdConflictException,
                                          Exception
Register a message view factory by class name, if it doesn't conflict with an existing factory.

Parameters:
factoryClassName - The name of the factory class to load and register.
Returns:
true if this call registered the factory or false if the factory was already registered.
Throws:
EAdmCompatibilityException - If the factory is not compatible with the runtime
SmaFactoryIdConflictException - If another factory of a different type is already registered.
Exception - If the factoryClassName cannot be loaded as a message view factory.
Threading:
This method is safe for concurrent access by multiple threads.

This method adds the supplied message view factory to the view factory registry. It will replace a factory of the same id if one exists.


registerIfNoConflict

public final boolean registerIfNoConflict(MessageViewFactory factory)
                                   throws SmaFactoryIdConflictException
Registers the given factory, if it doesn't conflict with an existing factory.

Parameters:
factory - The message factory to register
Returns:
true if this call registered the factory or false if the factory was already registered.
Throws:
EAdmCompatibilityException - If the factory is not compatible with the runtime
SmaFactoryIdConflictException - If another factory of a different type is already registered.
Threading:
This method is safe for concurrent access by multiple threads.

This method adds the supplied message view factory to the view factory registry. It will replace a factory of the same id if one exists.


getMessageViewFactory

public final MessageViewFactory getMessageViewFactory(short factoryId)
Get a view factory.

Parameters:
factoryId - The factory's unique identifier.
Threading:
This method is safe for concurrent access by multiple threads.

getMessageViewFactoryNames

public final Set<String> getMessageViewFactoryNames(Set<String> factories)
Get the names of the set of registered factories.

Parameters:
factories - The set to add the factory names to.
Returns:
Returns the updated set of factories.
Threading:
This method is safe for concurrent access by multiple threads.

dumpFactoryVersionInfo

public final void dumpFactoryVersionInfo(StringBuilder builder)
Dump the registered factories' version information.

Parameters:
builder - The set to add the factory names to.
Threading:
This method is safe for concurrent access by multiple threads.


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