The Spring Framework is an open source application framework for the Java platform. The core features of the Spring Framework can be used by any Java application, but there are extensions for building web applications on the Java Enterprise platform. Although the Spring Framework does not impose any specific programming model, it has become popular in the Java community as an alternative to, replacement for, or an addition to the Enterprise JavaBean (EJB) model.
This section explains how to integrate FioranoMQ client samples with Spring Framework.
The resources and libraries listed below are needed:
- FioranoMQ Server
- ant
- Jars –
Please download the following jars and store them in a directory named "lib" in the current sample's home folder.
- spring.jar (http://www.java2s.com/Code/Jar/Spring-Related/spring.jar.htm).
- commons-logging.jar (http://www.java2s.com/Code/Jar/jboss-5.0.0.Beta2/commons-logging.jar.htm).
The jars listed below are shipped along with FioranoMQ: (Modify the build files to include these jars only when the sample is moved from its default location.)
- fmq-client.jar
- fiorano-framework.jar
- jms.jar
The Samples for the Spring Framework are present in the directories listed below:
<FMQ_HOME>/samples/PTP/SpringSamples
<FMQ_HOME>/samples/PubSub/SpringSamples
The sample directory comprises of the two directories listed below:
- The "lib" directory should contain the necessary jars.
- The "src" directory contains the java samples and the Spring configuration files.
The Spring configurations are present under the directory "src/spring/".
These xml files provide the samples with configurations like destination, ContextFactory, ConnectionFactory and so on.
The java samples are present under the directory "src/springexample/client". These java files pickup configurations from xml files.
Samples can be run using the following command from the sample's home directory: ant -f build-jmsreceiver.xml. A detailed explanation can be found in the readme files provided in the samples directories.