Package org.frankframework.unmanaged
Class SpringJmsConnector
java.lang.Object
org.frankframework.unmanaged.AbstractJmsConfigurator
org.frankframework.unmanaged.SpringJmsConnector
- All Implemented Interfaces:
jakarta.jms.ExceptionListener
,IListenerConnector<jakarta.jms.Message>
,IThreadCountControllable
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.jms.listener.SessionAwareMessageListener<jakarta.jms.Message>
public class SpringJmsConnector
extends AbstractJmsConfigurator
implements IListenerConnector<jakarta.jms.Message>, IThreadCountControllable, org.springframework.beans.factory.BeanFactoryAware, jakarta.jms.ExceptionListener, org.springframework.jms.listener.SessionAwareMessageListener<jakarta.jms.Message>
Configure a Spring JMS Container from a
PushingJmsListener
.
This implementation expects to receive an instance of org.springframework.jms.listener.DefaultMessageListenerContainer from the Spring BeanFactory. If another type of MessageListenerContainer is created by the BeanFactory, then another implementation of IListenerConnector should be provided as well.
This implementation works only with a PushingJmsListener, and not with other types PortConnectedListeners.
- Since:
- 4.8
- Author:
- Tim van der Leeuw
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.frankframework.core.IListenerConnector
IListenerConnector.CacheMode
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
Fields inherited from class org.frankframework.unmanaged.AbstractJmsConfigurator
log
Fields inherited from interface org.frankframework.core.IListenerConnector
THREAD_CONTEXT_SESSION_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configureEndpointConnection
(IPortConnectedListener<jakarta.jms.Message> jmsListener, jakarta.jms.ConnectionFactory connectionFactory, CredentialFactory credentialFactory, jakarta.jms.Destination destination, IbisExceptionListener exceptionListener, IListenerConnector.CacheMode cacheMode, int acknowledgeMode, boolean sessionTransacted, String messageSelector, long receiveTimeout, long pollGuardInterval) void
int
org.springframework.jms.listener.DefaultMessageListenerContainer
long
int
org.springframework.transaction.PlatformTransactionManager
void
boolean
boolean
void
onException
(jakarta.jms.JMSException e) void
onMessage
(jakarta.jms.Message message, jakarta.jms.Session session) void
setBeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory) void
setLastPollFinishedTime
(long lastPollFinishedTime) void
setTxManager
(org.springframework.transaction.PlatformTransactionManager txManager) void
start()
Start Listener-port to which the Listener is connected.void
stop()
Stop Listener-port to which the Listener is connected.Methods inherited from class org.frankframework.unmanaged.AbstractJmsConfigurator
configureEndpointConnection, getConnectionFactory, getDestination, getExceptionListener, getListener, getReceiver, setConnectionFactory, setDestination, setListener
-
Field Details
-
DEFAULT_CACHE_LEVEL_TRANSACTED
public static final int DEFAULT_CACHE_LEVEL_TRANSACTED- See Also:
-
DEFAULT_CACHE_LEVEL_NON_TRANSACTED
public static final int DEFAULT_CACHE_LEVEL_NON_TRANSACTED- See Also:
-
IDLE_TASK_EXECUTION_LIMIT
public static final int IDLE_TASK_EXECUTION_LIMIT- See Also:
-
-
Constructor Details
-
SpringJmsConnector
public SpringJmsConnector()
-
-
Method Details
-
configureEndpointConnection
public void configureEndpointConnection(IPortConnectedListener<jakarta.jms.Message> jmsListener, jakarta.jms.ConnectionFactory connectionFactory, CredentialFactory credentialFactory, jakarta.jms.Destination destination, IbisExceptionListener exceptionListener, IListenerConnector.CacheMode cacheMode, int acknowledgeMode, boolean sessionTransacted, String messageSelector, long receiveTimeout, long pollGuardInterval) throws ConfigurationException - Specified by:
configureEndpointConnection
in interfaceIListenerConnector<jakarta.jms.Message>
- Throws:
ConfigurationException
-
start
public void start()Description copied from interface:IListenerConnector
Start Listener-port to which the Listener is connected.- Specified by:
start
in interfaceIListenerConnector<jakarta.jms.Message>
-
stop
public void stop()Description copied from interface:IListenerConnector
Stop Listener-port to which the Listener is connected.- Specified by:
stop
in interfaceIListenerConnector<jakarta.jms.Message>
-
onMessage
public void onMessage(jakarta.jms.Message message, jakarta.jms.Session session) throws jakarta.jms.JMSException - Specified by:
onMessage
in interfaceorg.springframework.jms.listener.SessionAwareMessageListener<jakarta.jms.Message>
- Throws:
jakarta.jms.JMSException
-
onException
public void onException(jakarta.jms.JMSException e) - Specified by:
onException
in interfacejakarta.jms.ExceptionListener
-
isThreadCountReadable
public boolean isThreadCountReadable()- Specified by:
isThreadCountReadable
in interfaceIThreadCountControllable
-
isThreadCountControllable
public boolean isThreadCountControllable()- Specified by:
isThreadCountControllable
in interfaceIThreadCountControllable
-
getCurrentThreadCount
public int getCurrentThreadCount()- Specified by:
getCurrentThreadCount
in interfaceIThreadCountControllable
-
getMaxThreadCount
public int getMaxThreadCount()- Specified by:
getMaxThreadCount
in interfaceIThreadCountControllable
-
increaseThreadCount
public void increaseThreadCount()- Specified by:
increaseThreadCount
in interfaceIThreadCountControllable
-
decreaseThreadCount
public void decreaseThreadCount()- Specified by:
decreaseThreadCount
in interfaceIThreadCountControllable
-
getLogPrefix
-
getTxManager
public org.springframework.transaction.PlatformTransactionManager getTxManager() -
setTxManager
public void setTxManager(org.springframework.transaction.PlatformTransactionManager txManager) -
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) - Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
-
getJmsContainer
public org.springframework.jms.listener.DefaultMessageListenerContainer getJmsContainer() -
getThreadsProcessing
-
getLastPollFinishedTime
public long getLastPollFinishedTime() -
setLastPollFinishedTime
public void setLastPollFinishedTime(long lastPollFinishedTime)
-