IBM WebSphere Adapters Network Card User Manual


 
discovery and the one that used for run time. The copy is based on names. For
example, if a property name Username exists in the configuration used for
discovery and that used for run time, the Username value is copied.
public ServiceDescription createServiceDescription
(MetadataSelection importSelection) throws MetadataException {
ServiceDescription description = null;
WBIMetadataSelectionImpl selection = (WBIMetadataSelectionImpl)
importSelection;
MetadataImportConfiguration[] confArray = selection.getSelection();
if (confArray.length == 0)
return description;
super.getLogUtils().trace(Level.FINER,
CLASSNAME, "createServiceDescription()",
"Number of MetadataImportConfigurations " + confArray.length);
PropertyGroup serviceType = selection.getAppliedSelectionProperties();
String directionality = getDirectionality(serviceType);
String nameSpace = getNameSpace(serviceType);
boolean inbound = false;
if (directionality.equals("Inbound")) {
super.getLogUtils().trace(Level.FINER, CLASSNAME,
"createServiceDescription()",
"Selected Service Type is:Inbound");
inbound = true;
}
if (inbound) {
description = createInboundServiceDescription
(importSelection, selection, nameSpace);
} else {
description = createOutboundServiceDescription
(importSelection, selection, nameSpace);
}
return description;
}
setToolContext
To implement setToolContext(), initialize the LogUtils instance and set it on the
Foundation Class WBIMetadataDiscoveryImpl.
public void setToolContext(ToolContext toolContext) {
super.setToolContext(toolContext);
try {
LogUtils logUtils = new LogUtils(toolContext.getLogger(),
CURRENT_PACKAGE, "TwineBall Adapter", "6.0.0");
if(logUtils != null) logUtils.trace(Level.FINER, CLASSNAME,
"getToolContext()", "LogUtils Initilialized");
super.setLogUtils(logUtils);
} catch (ResourceAdapterInternalException e) {
e.printStackTrace();
System.out.println(e.getMessage());
System.out.println("Unable to create LogUtils instance");
}
}
WBIAdapterTypeImpl sample:
You use this class to implement the adapter type for enterprise metadata discovery.
Extend WBIAdapterTypeImpl and implement the methods described in the sections
below.
Constructor
The constructor populates the adapter type instance as shown below:
WebSphere Adapter development overview 141