THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.apache.camel.example</groupId> <artifactId>reportincident.model</artifactId> <!-- STEP 1 --> <packaging>bundle</packaging> <name>Report Incident Model Bundle</name> <version>1.0-SNAPSHOT</version> <properties> <felix-version>1.4.3</felix-version> <camel-version>2.0-M1</camel-version> <commons-lang>2.4</commons-lang> </properties><parent> <groupId>org.apache.camel.example</groupId> <artifactId>reportincident.parent</artifactId> <version>1.0-SNAPSHOT</version> </parent> <dependencies> <!-- Camel bindy --> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-bindy</artifactId> <version>${camel-version}</version> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>${commons-lang}</version> </dependency> </dependencies> <build> <plugins> <!-- to compile with 1.5 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> <!-- STEP 2 --> <!-- to generate the MANIFEST-FILE of the bundle --> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <version>${felix-version}</version> <configuration> <manifestLocation>META-INF</manifestLocation> <instructions> <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> <!-- STEP 3 --> <Export-Package> '=META-INF.org.apache.camel.example.reportincident.model', org.apache.camel.example.reportincident.model </Export-Package> <_failok>true</_failok> </instructions> </configuration> </plugin> </plugins> </build> </project> |
...
Spring using the context:property-placeholder
(1) will be able to load it.
Remarks :
- We will see in the chapter 'deployment' where this file must be deployed.
- In our example, we have only defined
properties
for thedriver
,username
and {{password }} but you can extend the list of values with by example Hibernate parameters like hibernate.show_sql, hibernate.format_sql, ...
Step 3 : reportincident.service
...
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd"> <osgi:service ref="incidentService" interface="org.apache.camel.example.reportincident.service.IncidentService"/> </beans> |
Remark :
- Transaction Management has been defined in the corresponding files of reportincident.persistence and reportincident.service but we will not discuss them in detail in this tutorial.
Step 4 : reportincident.webservice
...
Now that we have transformed our current project in bundles, it is time to design the routing and web parts of the application. In the next part of the tutorial, we will specify modification to do for the new incoming projects/bundles
Links
- Part 2 : real example, architecture, project setup, database creation
- Part 2a : transform projects in bundles
- Part 2b : add infrastructure and routing
- Part 2c : web and deployment
#Resources
Attachments patterns .*part2.zip