In this section: |
Providers supply runtime services that intermediate between server component code and a common capability or service. Providers are configured once and referred to by name when configuring the component. For example, there might be several PKI keystores referenced by individual components such as SSL, digital signature, and so on. Each keystore would be accessed through a provider that is configured accordingly. By referencing the provider name in the component, the component gains access to the provider's services and configuration. Using providers enables the configuration to be centralized and simplifies use of the supplied service.
Among the provider types supported by the server are data access, keystore, SSL, namespace maps and LDAP.
Providers are instances of classes that offer a type-specific interface appropriate to the service being provisioned. With the exception of the data access provider, which offers the standard SQL DataSource interface, the interfaces are iWay proprietary and subject to change in future releases.
Access to a specific provider requires knowledge of the provider type and the name of the specific provider instance desired. Access to the desired provider follows the JNDI method of locating named objects.
Note: It is possible to access providers that are offered externally to the iWay server, although at this time only Data Sources offer standard usage patterns.
Accessing JNDI first requires the construction of a context factory. The default context factory is the iWay server, however, the formal statement of this is always a good idea:
Hashtable ht = new Hashtable(2); ht.put ("java.naming.factory.initial", "com.ibi.jndi.XDInitialContectFactory");
Once the Hashtable has been constructed, you can create your JNDI context, for example:
Javax.naming.Context ctx = new InitialContext(ht);
Now that the context is available, it can be used to locate the required provider. The access name consists of the type and the configured name as a string <type>/<name>. For example, a JDBC data source (JDBC provider) named "correltable" would be accessed as:
DataSource ds = (DataSource)ctk.lookup("jdbc/correltable")
The following table lists the object type names and their associated class instances:
Name | Class is | Explosed Methods |
---|---|---|
jdbc | DataSource | javax.sql.DataSource |
ldap | XDLdapProvider | iWay Specific |
dircertstore | XDDirCertstoreProvider | iWay Specific |
keystore | XDKeystoreProvider | iWay Specific |
sslcontext | XDSSLContextProvider | iWay Specific |
nsmap | XDNsmapProvider | iWay Specific |
Providers extend XDProviderbase, which offers some common methods. In turn, XDProviderBase extends XDExitBase. In this manner, providers set their configuration metadata and are configured in the same manner as other exits.
For more detailed information on the individual providers, see the Javadoc that is provided with the product.
iWay Software |