Class RabbitMQSingletons
- java.lang.Object
-
- com.oneandone.iocunit.jms.rabbitmq.RabbitMQSingletons
-
- All Implemented Interfaces:
com.oneandone.iocunit.jms.JmsSingletonsIntf
@Singleton public class RabbitMQSingletons extends Object implements com.oneandone.iocunit.jms.JmsSingletonsIntf
Manages the singleton used to mock JMS in CDI-Unit using rabbitmq.- Author:
- aschoerk
-
-
Constructor Summary
Constructors Constructor Description RabbitMQSingletons()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.jms.QueuecreateQueue(String name)jakarta.jms.TopiccreateTopic(String name)voiddestroy()make sure a new weld-container can be created without residuejakarta.jms.ConnectiongetConnection()jakarta.jms.ConnectionFactorygetConnectionFactory()creates the jms-connectionfactory which is injected anywhere during the tests.voidjms2OnMessage(jakarta.jms.MessageListener listener, jakarta.jms.Message message)
-
-
-
Method Detail
-
getConnection
public jakarta.jms.Connection getConnection()
- Specified by:
getConnectionin interfacecom.oneandone.iocunit.jms.JmsSingletonsIntf
-
destroy
@PreDestroy public void destroy()
make sure a new weld-container can be created without residue- Specified by:
destroyin interfacecom.oneandone.iocunit.jms.JmsSingletonsIntf
-
createQueue
public jakarta.jms.Queue createQueue(String name)
- Specified by:
createQueuein interfacecom.oneandone.iocunit.jms.JmsSingletonsIntf
-
createTopic
public jakarta.jms.Topic createTopic(String name)
- Specified by:
createTopicin interfacecom.oneandone.iocunit.jms.JmsSingletonsIntf
-
getConnectionFactory
public jakarta.jms.ConnectionFactory getConnectionFactory() throws Exceptioncreates the jms-connectionfactory which is injected anywhere during the tests.- Specified by:
getConnectionFactoryin interfacecom.oneandone.iocunit.jms.JmsSingletonsIntf- Returns:
- one ConnectionFactory able to create mockrunner-jms-objects
- Throws:
Exception- should not occur since mockrunner uses the main memory for jms.
-
jms2OnMessage
public void jms2OnMessage(jakarta.jms.MessageListener listener, jakarta.jms.Message message)- Specified by:
jms2OnMessagein interfacecom.oneandone.iocunit.jms.JmsSingletonsIntf
-
-