官术网_书友最值得收藏!

Creating your first project

The following steps will help you in creating your first project:

  1. Create a Spring Integration project by navigating to File | Spring Project, as shown in the following screenshot:
    Creating your first project
  2. Under the templates section, select Spring Integration Project - Simple. Provide a project name, for example, sisimple, as shown in the following screenshot:
    Creating your first project
  3. Fill in the information required to create a Maven-based project, as shown in this screenshot:
    Creating your first project
  4. Click on Finish; this will create a project with the name that was provided by us (sisimple), as shown in this screenshot:
    Creating your first project

This project is as simple as it can be. Let's take a quick look at the generated Java classes in the following points:

  • Main.java: This file is located at the path: /sisimple/src/main/java/com/chandan/example/si/. It has the main method and will be used to run this sample. Right-click on this file from the package explorer and click on Run As | Java Application—this will start the program. This class has the code to bootstrap Spring Integration configuration files and load components defined in it. Additionally, it converts user input to upper case.
  • StringConversionService.java: This file is located at the path: /sisimple/src/main/java/com/chandan/example/si/service/. This is the service interface that is used to convert user input to upper case.
  • spring-integration-context.xml: This file is located at the path: /sisimple/src/main/resources/META-INF/spring/integration/. It is the Spring Integration configuration file. It contains the XML-based declaration of Spring Integration components.
  • log4j.xml: This file is located at the path: /sisimple/src/main/resources/. It is the Log4j configuration file. It can be edited to control the log level, appenders, and other logging-related aspects.
  • StringConversionServiceTest.java: This file is located at the path: /sisimple/src/test/java/com/chandan/example/si/. This is the test file for StringConversionService. This will be used to run tests against the service classes.
  • pom.xml: This is the file used for rmaven dependency management, located in /sisimple/. It has entries for all the dependencies used by the project.

It will be a bit heavy and premature to explain each of the components in these classes and configuration files without having built up some theoretical concepts—we will discuss each of the elements in detail, as we move ahead in the chapters.

主站蜘蛛池模板: 茶陵县| 甘肃省| 晋州市| 葫芦岛市| 广安市| 屯门区| 阿拉善盟| 鹿邑县| 景泰县| 清河县| 博湖县| 通化县| 怀宁县| 洞口县| 定远县| 油尖旺区| 腾冲县| 龙门县| 日照市| 饶河县| 静海县| 陇川县| 辰溪县| 铁岭县| 贡觉县| 金川县| 莱州市| 清水县| 虎林市| 武夷山市| 苏尼特右旗| 双江| 当涂县| 得荣县| 尼木县| 伽师县| 育儿| 延吉市| 宜丰县| 饶平县| 阿城市|