Adapter Development Kit 6.5 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Listener Notifications | Listener Notification Implementation | Implementing Resource Domains
 
Implementing Resource Domains
As previously mentioned, this example uses an alternative approach to managing its resource domains. This is evident in the modifications to the signatures of the three resource domain value methods shown below. Completing this implementation also requires some changes to the way your connection is implemented, as described in An Alternative Approach to Organizing Resource Domains. Alternatively, you may implement the registerResourceDomain method shown below in your connection factory, and the remaining methods in your connection, as shown in previous sections of this document.
Note:
In this example, notice the use of class.getName when specifying data types. Using this technique enables you to catch spelling errors at compile time.
private static final String[] _sigFieldNames ={
"timeStamp",
"component",
"rootContext",
"parentContext",
"currentContext",
"server",
"eventCode",
"user",
"sessionName",
"RPCs",
"age"};
public Boolean adapterCheckValue(
WmManagedConnection connection,
String resourceDomainName,
String[][] values,String testValue) throws AdapterException
{
return null;
}
public ResourceDomainValues[] adapterResourceDomainLookup(
WmManagedConnection connection,
String resourceDomainName,
String[][] values) throws AdapterException
{
ResourceDomainValues[] results = null;
if (resourceDomainName.equals(FIELD_NAMES_RD)
|| resourceDomainName.equals(FIELD_TYPES_RD))
{
ResourceDomainValues names =
new ResourceDomainValues(FIELD_NAMES_RD,_sigFieldNames);
ResourceDomainValues types =
new ResourceDomainValues(FIELD_TYPES_RD,new String[] {
Date.class.getName(), //timestamp
String.class.getName(), // component
String.class.getName(), // rootContext
String.class.getName(), // parentContext
String.class.getName(), // currentContext
String.class.getName(), // server
Integer.class.getName(), // eventCode
String.class.getName(), // user
String.class.getName(), // sessionName
Integer.class.getName(), // RPCs
Long.class.getName() // age
});
results = new ResourceDomainValues[] {names,types};
}
return results;
}
public void registerResourceDomain(WmManagedConnection connection,
WmAdapterAccess access)
throws AdapterException
{
access.addResourceDomainLookup(
this.getClass().getName(),FIELD_NAMES_RD,connection);
access.addResourceDomainLookup(
this.getClass().getName(),FIELD_TYPES_RD,connection);
}