public class TimedInactivityProducerSessionFactory extends ProducerSessionFactoryImpl
ProducerSessionFactory
that creates a new session/producer based an inactivity timer.
This implementaton refreshes the session based on some on the specified interval between the last message and the current message
In the adapter configuration file this class is aliased as jms-timed-inactivity-producer-session which is the preferred alternative to the fully qualified classname when building your configuration.
log, session
Constructor and Description |
---|
TimedInactivityProducerSessionFactory() |
TimedInactivityProducerSessionFactory(TimeInterval interval) |
Modifier and Type | Method and Description |
---|---|
ProducerSession |
createProducerSession(JmsProducerImpl producer,
AdaptrisMessage msg)
Create or reuse an existing session.
|
TimeInterval |
getInactivityInterval() |
void |
setInactivityInterval(TimeInterval inactivityInterval)
Set the inactivity interval before a new session is created.
|
close, closeQuietly, createProducerSession, init, start, stop
public TimedInactivityProducerSessionFactory()
public TimedInactivityProducerSessionFactory(TimeInterval interval)
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 TimeInterval getInactivityInterval()
public void setInactivityInterval(TimeInterval inactivityInterval)
inactivityInterval
- the interval, if not specified, the default is 2 hours.