Package com.adaptris.core.jms
Class MetadataProducerSessionFactory
- java.lang.Object
-
- com.adaptris.core.jms.ProducerSessionFactoryImpl
-
- com.adaptris.core.jms.MetadataProducerSessionFactory
-
- All Implemented Interfaces:
ComponentLifecycle
,ProducerSessionFactory
public class MetadataProducerSessionFactory extends ProducerSessionFactoryImpl
Implementation ofProducerSessionFactory
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.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.jms.ProducerSessionFactoryImpl
log, session
-
-
Constructor Summary
Constructors Constructor Description MetadataProducerSessionFactory()
MetadataProducerSessionFactory(java.lang.String key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class com.adaptris.core.jms.ProducerSessionFactoryImpl
close, closeQuietly, createProducerSession, init
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
start, stop
-
-
-
-
Method Detail
-
createProducerSession
public ProducerSession createProducerSession(JmsProducerImpl producer, AdaptrisMessage msg) throws javax.jms.JMSException
Description copied from interface:ProducerSessionFactory
Create or reuse an existing session.- Parameters:
producer
- theJmsProducerImpl
instancemsg
- the message that the producer is currently handling.- Returns:
- a
ProducerSession
- Throws:
javax.jms.JMSException
- if there was a problem creating the session.
-
getMetadataKey
public java.lang.String getMetadataKey()
-
setMetadataKey
public void setMetadataKey(java.lang.String key)
Set the metadata key which will cause a session to be refreshed.- Parameters:
key
- the metadata key, defaults to 'newJmsSession'
-
-