Foreign Exchange component uses the UDTT ElementFactory as its IOC (Inversion of Control) container, so the configuration of Foreign Exchange component complies with the UDTT ElementFactory configuration rules. For more information about ElementFactory, see ElementFactory.
Configuring ForeignExchangeImpl
Following is an example of how to configure ForeignExchangeImpl:
Start WebSphere Application Server v6.1 and configure WebSphere for Cash Drawer Management Service.
1 In Servers view of the Rational Software Development platform, select the WebSphere Application Server v6.1 and click to start server. Following is the screen capture of the start view:
2 Right-click the WebSphere Application Server v6.1, and then click Run administrative console.
3 Configure JDBC Library Path.
Select Environment > WebSphere Variables. Update the DB2UNIVERSAL_JDBC_DRIVER_PATH and DB2_JDBC_DRIVER_PATH variables with the DB2 lib path, for example “C:\Program Files\IBM\SQLLIB\java”.
Following is the screen capture of updating variable:
4 Click OK to confirm the changes, and click Save to save the changes.
5 Create JDBC Providers.
▪ Click Resources > JDBC Providers. All the database providers are listed here. Following is the screen capture of JDBC providers:
Click New to create a new JDBC Provider. In the new page, select DB2 as Database type; select DB2 Universal JDBC Driver Provider as Provider type; select XA data source as Implementation type; fill the Name with FX-DB2-XA-JDBCProvider. Following is a screen capture of creating a new JDBC Provider:
Go to Step 3, click OK to save the changes.
6 Create Data Source.
7 Click Resources > JDBC Providers > FX-DB2-XA-JDBCProvider in this JDBC providers Configuration view. In the Additional Properties section, there is Data sources link. Following is the screen capture of configuration:
8 Click Data sources. All data sources are listed in this new page.
9 Click New to create a new data source. In the new page, fill the Data source name with FXDataSource, fill the JNDI name with jndi/FXDB. Following is the screen capture of data source information:
10 Click Create a new J2C authentication alias to create J2C authentication. Following is the screen capture of creating a new J2C authentication alias:
11 Select new created FXAuthenticate as the J2C authentication data entries. Following is the screen capture of J2C authentication data entries:
12 Fill the Database name, and Server name as “localhost” as in the example as follows:
13 Click Next > OK to save the changes.
Configuring RatesRepositoryDB2Impl
Following is an example of how to configure Rates Repository:
Because the Rates Repository layer is the bottom layer of the component and is tightly coupled with the datastorage, you can configure its attributes according to its implementation requirements. In this example, the attributes of the tag specifies jndi name of the data source, and the dbschema.
The UNICOM® Digital Transformation Toolkit (UDTT™) ElementFactory organizes the dependency between different layers of the component according to the configuration. To instantiate the ForeignExchangeImpl, the client application is required to maintain a reference to the ElementFactory. To decouple with the implementation, the ForeignExchange interface has to be used to keep the reference of the ForeignExchangeImpl instance.
Example
ElementFactory factory = new UniversalElementFactory("jar:///foreignExchange.xml"); ForeignExchange fx = (ForeignExchange) factory.getElement("ForeignExchange");