Package com.adaptris.core.jms
Class TimedInactivityProducerSessionFactory
- java.lang.Object
-
- com.adaptris.core.jms.ProducerSessionFactoryImpl
-
- com.adaptris.core.jms.TimedInactivityProducerSessionFactory
-
- All Implemented Interfaces:
ComponentLifecycle
,ProducerSessionFactory
public class TimedInactivityProducerSessionFactory extends ProducerSessionFactoryImpl
Implementation ofProducerSessionFactory
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.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.jms.ProducerSessionFactoryImpl
log, session
-
-
Constructor Summary
Constructors Constructor Description TimedInactivityProducerSessionFactory()
TimedInactivityProducerSessionFactory(TimeInterval interval)
-
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.TimeInterval
getInactivityInterval()
void
setInactivityInterval(TimeInterval inactivityInterval)
Set the inactivity interval before a new session is created.-
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
-
-
-
-
Constructor Detail
-
TimedInactivityProducerSessionFactory
public TimedInactivityProducerSessionFactory()
-
TimedInactivityProducerSessionFactory
public TimedInactivityProducerSessionFactory(TimeInterval interval)
-
-
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.
-
getInactivityInterval
public TimeInterval getInactivityInterval()
-
setInactivityInterval
public void setInactivityInterval(TimeInterval inactivityInterval)
Set the inactivity interval before a new session is created.- Parameters:
inactivityInterval
- the interval, if not specified, the default is 2 hours.
-
-