Adapter Development Kit 9.12 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Connections | Creating a WmManagedConnectionFactory Implementation Class | Metadata Model for Connection
 
Metadata Model for Connection
Each adapter interface field for configuring connection types must have a corresponding metadata parameter, provided by the associated connection factory. The webMethods metadata models are designed to define, refine, organize, and constrain parameters used to configure namespace nodes for connections, adapter services, and notifications. The metadata model for connections is the foundation for the more complicated metadata model used to configure adapter services and notifications.
Each metadata parameter is identified by a set accessor method. For example:
public void setHostName(String name);
public void setPortNumber(int portNumber);
Metadata Parameter Names
You derive the name of a parameter from the name of its set method. You remove the prefix (set) and make the first letter lower case. Thus, the set methods above would define metadata parameters named serverName and portNumber. For example:
public void setHostName(String name) {
}
public void setPortNumber(int portNumber) {
}
The complete naming convention rules follow the Java bean property naming conventions.
Some naming variations include:
setFoo() -> parameter name is "foo"
setfoo() -> parameter name is "foo"
setFOO() -> parameter name is "FOO"
setFOo() -> parameter name is "Foo"
set_foo() -> parameter name is "_foo"
set_Foo() -> parameter name is "_Foo"
Metadata Parameter Arguments
A metadata parameter's set method must accept a single argument, whose data type defines the data type of the parameter. For connections, this type must be limited to a Java primitive or a java.lang.String types. Arrays (or sequence parameters) are allowed, but the adapter's administrative interface only provides widgets to access the first element of the array. Other object types are interpreted as external Java bean classes, as described in Implementing Metadata Parameters Using External Classes.
In addition to defining the parameter name and data type, the set method of a metadata parameter is used at run time to pass the value of the parameter to the connection factory. In the example, the metadata accessor methods are shown as methods of the connection factory implementation class. In fact, any method in the connection factory implementation conforming to the naming convention is interpreted as a metadata parameter accessor method.
Metadata Parameter get Accessor Methods
A metadata parameter may have a corresponding get accessor method (following the same naming convention) that returns the same data type as the argument of the set method. The adapter uses these get methods only to retrieve default parameter values when creating a new connection.
Creating a get method with a different data type than its corresponding set method results in an error. In addition, creating a get method without a set method produces a parameter whose values are unusable.
Note:
All namespace nodes store parameter settings based on the parameter name. If you delete or change the name of your accessor methods, the parameter names stored in the namespace nodes associated with that class are no longer be valid. From that point forward, any use of that node (at design time or at run time) fails. If you no longer need a metadata parameter after upgrading a deployed adapter, hide the parameter (using WmDescriptor.setHidden) instead of deleting it.