Using the Sun Data Mashup Engine

Data Mashup Service Engine Application Configurations

This topic provides information about creating an application configuration for the Data Mashup Service Engine. When you design a Data Mashup application, you will likely use development or test data sources rather than production sources. When you move a Data Mashup project to staging and later to production, you might need to change the connection information and other properties for the new environment. Application configurations allow you to do this without having to reconfigure the design-time project.

Application configurations enable these dependencies to be externalized and configured. If you use application configurations to define different data sources, you need to create a connection pool and JDBC resource for each source database. Then you can specify the JNDI name of the resource in the application configuration.

You can create a configuration using either the GlassFish Enterprise Server Admin Console or the Application Configuration Editor, which is accessed through the NetBeans JBI Manager on the Service window. This topic provides instructions for both methods.

To create an application configuration, perform the following steps in the order given:

ProcedureTo View Design-Time Connection Information for Source Tables

You can view a list of source connections and their database properties from the EDM file in a Data Mashup project. This can help you determine whether you need to create an application configuration to define different source databases. an Application configuration can overwrite these values at runtime.

  1. On the NetBeans IDE Project window, expand the Data Mashup project and double-click the EDM file to open it.

  2. Right-click on the EDM Editor canvas, and then select Database Properties.

  3. For each source connection listed, select the source connection and view the connection URL and login information.

ProcedureTo Create Connection Pools and JDBC Resources

For an application configuration, you need to create one connection pool and one JDBC resource for each source database. You can use up to five source connections in an application configuration.

For more information about creating connection pools and JDBC resources, see Chapter 3, JDBC Resources, in Sun GlassFish Enterprise Server 2.1 Administration Guide.

  1. Launch the GlassFish Admin Console.

  2. For each source database used in the Data Mashup project, create one connection pool.


    Note –

    The URL property is mandator for Derby connection pools. Make sure to add that property in the connection pool and enter the URL in the correct format.


  3. For each connection pool you created, create a corresponding JDBC resource.

ProcedureTo Create a Data Mashup Application Configuration (From the Admin Console)

  1. Launch the GlassFish Admin Console.

  2. Under Common Tasks, expand JBI->Components, and then select sun-edm-engine.

    The Service Engine General Properties page appears.

  3. Click the Application tab, and then click Add Configuration.

  4. In the Identification section, enter a name for the application configuration.

  5. In the General Properties section, enter the following information:

    • DataDir – The path to the source data files.

    • DynamicFlatFile – An indicator of whether the Data Mashup SE uses the file name passed in the input query (in the URL or SOAP request, for example). When this property is set to “true”, the Data Mashup SE uses the file name in the input query. When this property is set to “false”, the Data Mashup SE constructs the file path using the value of the DataDir property plus the file name passed in. When this property is not set, it defaults to user.home.

    • SourceConnection#– The JNDI names of the JDBC resources you created above.

    • WorkingDir – The directory where temporary virtual database instances are created. If not set, this defaults to user.home.

  6. Click Save.

ProcedureTo Create a Data Mashup Application Configuration (From NetBeans)

  1. On the NetBeans IDE, click the Services tab.

  2. Start the GlassFish server.

  3. Expand Servers > GlassFish V2 > JIB > Service Engines.

  4. Right–click sun-edm-engine and select Properties.

  5. Click the Ellipses button next to the Application Configuration property.

    The Application Configuration Editor appears.

  6. Click Add.

    An empty row appears.

  7. Enter the following information (click in the blank cell under a column name to add a value):

    • Configuration – A unique name for the application configuration.

    • DataDir – The path to the source data files.

    • DynamicFlatFile – An indicator of whether the Data Mashup SE uses the file name passed in the input query (in the URL or SOAP request, for example). When the property is set to “true”, the Data Mashup SE uses the file name in the input query. When the property is set to “false”, the Data Mashup SE constructs the file path using the value of the DataDir property plus the file name passed in. When this property is not set, it defaults to user.home.

    • SourceConnection#– The JNDI names of the JDBC resources you created above.

    • WorkingDir – The directory where temporary virtual database instances are created. If not set, this defaults to user.home.

  8. Click Save.

ProcedureTo Associate the Application Configuration With an Endpoint

Once you create the application configuration, you need to associate it with a composite application service unit endpoint. Then you can deploy the application and the new configuration is applied.

  1. In NetBeans, open the Service Assembly file that contains the Data Mashup project to configure. If the Service Assembly file does not exist, do the following:

    • Create the composite application project.

    • Add the Data Mashup project to the composite application.

    • Build the composite application project.

    • Expand the composite application node, and then double-click on the Service Assembly node to open the CASA Editor.

  2. On the CASA Editor, right-click the endpoint with which you want to associate the application configuration, and then click Properties.

  3. In the Config Extension section of the Properties window, enter the name of the application configuration you created earlier.

  4. Save the Service Assembly.

  5. Deploy the project.

    After you have deployed the project, your changes to the configuration are applied, providing you with a runtime switch of connections.