public interface JmsSenderMapperFactory
The configuration of this class should be fully validated as part of init()
to ensure errors are
flagged to the user as early as possible.
For simple cases, consider using the SimpleAbstractJmsMessageMapper
base class to implement this interface.
Note: Mappers that are entirely stateless may use the same class to implement both this factory and the JmsSenderMapper interface, returning the same JmsSenderMapper instance in all cases. However mappers that have read-write data structures or need to cache data (e.g. XML factories, etc) should store it in the single-threaded JmsSenderMapper instances to avoid contention and maximize concurrency.
Threading: see documentation on each method below.
Modifier and Type | Method and Description |
---|---|
JmsSenderMapper |
createJmsSenderMapper()
Factory method for creating a mapper that will be used by a single thread.
|
void |
init()
Initialization method to be called after all configuration properties have been assigned, to initialize this factory and validate the
configuration.
|
void init() throws java.lang.Exception
If the configuration is invalid in any way then an exception should be thrown from this method. This method must be idempotent, as it may be called more than once during initialization (although always on the configuration loading thread, so there is no need for synchronization here).
java.lang.Exception
JmsSenderMapper createJmsSenderMapper()
Any configuration information needed by the mapper that is not safe for concurrent unsynchronized access should be copied into the new mapper instance. Mappers that do not have any state are allowed to return the same instance every time this method is called.
The configuration will have been validated by the factory's init()
method before this method is called
so it is expected that this method should never throw an exception.
Threading: this method must be thread safe. Implementations may need to take a copy of any configuration data structures (e.g. caches) that could potentially be mutated by other mapper threads. Any data that is not safe for concurrent unsynchronized access should be stored in the JmsSenderMapper instances created by the factory.
Submit a bug or feature
Copyright (c) 2013-2019 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.