16.01.2014 Views

Diploma Thesis Santiago Gómez Sáez - IAAS

Diploma Thesis Santiago Gómez Sáez - IAAS

Diploma Thesis Santiago Gómez Sáez - IAAS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6. Implementation<br />

multi-tenancy awareness operations which listen to and send messages to multi-tenant aware<br />

JBI endpoints.<br />

In the design approach two for SQL support described in Chapter 5 we define two Camel JBI<br />

endpoints for routing requests to the CDASMixjdbc component: the tentants’ JBI endpoints,<br />

and the JBIToCamelJdbc endpoint. The former is deployed on ServiceMix-camel-mt, and the<br />

latter on ServiceMix-camel. Both routes definitions are packed and deployed in different SUs,<br />

and SAs, due to their deployment on different components. In the URI endpoint definition<br />

we set the Camel JBI option check serialization= nocheck, which deactivates the serialization<br />

checking of objects contained in the property section of the NMF. The objects the system<br />

sends in the NMF properties section implement the interface serializable. Therefore, there is<br />

no need of overloading the system with checking operations. The JBIToCamelJdbc endpoint<br />

forwards the messages exchanges to the CDASMixjdbc camel component (see Listing 6.3).<br />

6.1.3. Camel CDASMix JDBC Component<br />

The Camel CDASMix JDBC component provides support for creating and exchanging requests<br />

with external database systems via JDBC. We implement the communication support<br />

for the following three database systems: MySQL, PostgreSQL, and Oracle. The connections<br />

to the databases are established by utilizing its client native drivers via JDBC: mysql-connectorjava-5.1.22,<br />

postgresql-9.1-901.jdbc3, and ojdbc14-10.2.0. These are included in the OSGi bundle<br />

of the CDASMixjdbc component, and DataSource objects are created for establishing the<br />

connection with the backend database systems. The CdasmixDataSource interface is implemented<br />

by the three protocol specific datasources: CdasmixMySQLDS, CdasmixPostgresDS,<br />

and CdasmixOracleDS (see Figure A.2). Therefore, the database specific DataSource creation is<br />

handled in the DataSourceHandler class, which evaluates the target datasource driver property<br />

contained in the NMF. This class interacts with the JNDI registry of the system for registering,<br />

and retrieving the DataSource instances.<br />

1 ...<br />

2 <br />

4 <br />

5 <br />

6 <br />

7 <br />

8 <br />

9 ...<br />

Listing 6.3: Route definition for JBIToCamelJdbc JBI endpoint to JDBCCDASMix Camel<br />

Component.<br />

This component is developed as a custom camel component, and in the Camel registry its<br />

endpoints are identified by the prefix cdasmixjdbc (see Listing 6.3). The OSGi container allows<br />

the redeployment of the component without the need of redeploying the external components<br />

68

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!