public class MetadataProducerSessionFactory extends ProducerSessionFactoryImpl
ProducerSessionFactory
that creates a new session/producer based on message size.
This implementaton refreshes the session based whether an item of metadata evaluates to 'true'
In the adapter configuration file this class is aliased as jms-metadata-producer-session which is the preferred alternative to the fully qualified classname when building your configuration.
log, session
Constructor and Description |
---|
MetadataProducerSessionFactory() |
MetadataProducerSessionFactory(java.lang.String key) |
Modifier and Type | Method and Description |
---|---|
ProducerSession |
createProducerSession(JmsProducerImpl producer,
AdaptrisMessage msg)
Create or reuse an existing session.
|
java.lang.String |
getMetadataKey() |
void |
setMetadataKey(java.lang.String key)
Set the metadata key which will cause a session to be refreshed.
|
close, closeQuietly, createProducerSession, init
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
start, stop
public MetadataProducerSessionFactory()
public MetadataProducerSessionFactory(java.lang.String key)
public ProducerSession createProducerSession(JmsProducerImpl producer, AdaptrisMessage msg) throws javax.jms.JMSException
ProducerSessionFactory
producer
- the JmsProducerImpl
instancemsg
- the message that the producer is currently handling.ProducerSession
javax.jms.JMSException
- if there was a problem creating the session.public java.lang.String getMetadataKey()
public void setMetadataKey(java.lang.String key)
key
- the metadata key, defaults to 'newJmsSession'