commonj.connector.metadata.discovery
Interface AdapterConfiguration


public interface AdapterConfiguration

Represents an object used to configure the adapter execution environment. The tooling is expected to call this interface to get entries to be added to the adapter environment at the application or system level.

The implementation of this interface must not require any configuration of the adapter to run.

Implementations of this interface must have a default constructor so that tool environments are able to create instances of it during the bootstrap process. Implementations must be thread compatible (not thread-safe), as they may run in a threaded environment. Thread compatible requires that if a unique instance is used in each thread then correct behaviour is observed. Also, if the tool synchronizes calls to the methods then correct behaviour is observed except when internal state is changed. Applying the adapter environment properties or setting the application or system entries will change the state.

Since:
1.1

Method Summary
 void applyAdapterEnvironmentProperties(PropertyGroup configurationValues)
          Applies the configured property values to the adapter configuration.
 PropertyGroup createAdapterEnvironmentProperties()
          Creates a new instance of the properties that control how an adapter environment should be configured.
 URI[] getApplicationEntries()
          Returns the file URI locations to configuration files (such as Java JAR files or property files) that need to be placed in the application path.
 URI[] getSystemEntries()
          Returns the absolute file URI locations to configuration files (such as Java JAR files, property files or DLLs) that need to be placed in the system path.
 void setApplicationEntries(URI[] uris)
          Sets the absolute or relative URI locations for configuration files that currently are in the application path and part of the resource adapter.
 void setSystemEntries(URI[] uris)
          Set the absolute file URI location for current configuration files.
 

Method Detail

createAdapterEnvironmentProperties

PropertyGroup createAdapterEnvironmentProperties()
Creates a new instance of the properties that control how an adapter environment should be configured. If no application or system entries have been set or environment properties applied then a default PropertyGroup is rendered. If application or system entries have been set or environment properties have been applied then a PropertyGroup should be populated with that state.

Tool environments must call this method followed by applyAdapterEnvironmentProperties(PropertyGroup)immediately before calling getApplicationEntries() or getSystemEntries().

Returns:
a PropertyGroup representing the available configuration properties or null if no configuration properties exist.

applyAdapterEnvironmentProperties

void applyAdapterEnvironmentProperties(PropertyGroup configurationValues)
                                       throws MetadataException
Applies the configured property values to the adapter configuration. The PropertyGroup argument should have been created by createAdapterEnvironmentProperties method. The argument must not be null.

Parameters:
configurationValues - a non null property group that has been configured with values. The property group instance must have been created using the createAdapterEnvironmentProperties() method.
Throws:
MetadataException - if an error occured during execution. This includes if an invalid PropertyGroup was specified.

getApplicationEntries

URI[] getApplicationEntries()
Returns the file URI locations to configuration files (such as Java JAR files or property files) that need to be placed in the application path.

The tooling is responsible for determing where is tha appropriate location to place the files depending on the file extension. That is a .jar file will be placed in the classpath.

Returns:
Returns an array of file URI locations that need to be placed in the application path, or null if no values have been set or applied. The URI must be absolute unless it is a relative URI obtained from setApplicationEntries().

setApplicationEntries

void setApplicationEntries(URI[] uris)
                           throws MetadataException
Sets the absolute or relative URI locations for configuration files that currently are in the application path and part of the resource adapter.

Parameters:
uris - for configuration files that currently are in the application path of the resource adapter.
Throws:
MetadataException

getSystemEntries

URI[] getSystemEntries()
Returns the absolute file URI locations to configuration files (such as Java JAR files, property files or DLLs) that need to be placed in the system path.

The tooling is responsible for determing where is tha appropriate location to place the files depending on the file extension. That is a .jar file will be placed in the classpath.

Returns:
Returns an array of absolute file URI locations that need to be placed in the system path, or null if no values have been set or applied.

setSystemEntries

void setSystemEntries(URI[] uris)
                      throws MetadataException
Set the absolute file URI location for current configuration files.

Parameters:
uris - the current absolute file URI locations that are in the system path.
Throws:
MetadataException