Package org.apache.storm.jms.example
Class SpringJmsProvider
- java.lang.Object
-
- org.apache.storm.jms.example.SpringJmsProvider
-
- All Implemented Interfaces:
Serializable
,JmsProvider
public class SpringJmsProvider extends Object implements JmsProvider
AJmsProvider
that uses the spring framework to obtain a JMSConnectionFactory
andDesitnation
objects.The constructor takes three arguments:
- A string pointing to the the spring application context file contining the JMS configuration (must be on the classpath)
- The name of the connection factory bean
- The name of the destination bean
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SpringJmsProvider(String appContextClasspathResource, String connectionFactoryBean, String destinationBean)
Constructs aSpringJmsProvider
object given the name of a classpath resource (the spring application context file), and the bean names of a JMS connection factory and destination.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.jms.ConnectionFactory
connectionFactory()
Provides the JMSConnectionFactory
.javax.jms.Destination
destination()
Provides theDestination
(topic or queue) from which theJmsSpout
will receive messages.
-
-
-
Constructor Detail
-
SpringJmsProvider
public SpringJmsProvider(String appContextClasspathResource, String connectionFactoryBean, String destinationBean)
Constructs aSpringJmsProvider
object given the name of a classpath resource (the spring application context file), and the bean names of a JMS connection factory and destination.- Parameters:
appContextClasspathResource
- - the spring configuration file (classpath resource)connectionFactoryBean
- - the JMS connection factory bean namedestinationBean
- - the JMS destination bean name
-
-
Method Detail
-
connectionFactory
public javax.jms.ConnectionFactory connectionFactory() throws Exception
Description copied from interface:JmsProvider
Provides the JMSConnectionFactory
.- Specified by:
connectionFactory
in interfaceJmsProvider
- Returns:
- the connection factory
- Throws:
Exception
-
destination
public javax.jms.Destination destination() throws Exception
Description copied from interface:JmsProvider
Provides theDestination
(topic or queue) from which theJmsSpout
will receive messages.- Specified by:
destination
in interfaceJmsProvider
- Throws:
Exception
-
-