Class WBEMClientFactory
java.lang.Object
javax.wbem.client.WBEMClientFactory
This class defines the functionality of a
WBEMClient factory,
which is used to retrieve a WBEMClient for a specified protocol.
An example of how to use the factory is included below.
...
WBEMClient cc = null;
try {
cc = WBEMClientFactory.getClient(WBEMClientConstants.PROTOCOL_CIMXML);
} catch (Exception e) {
System.out.println("Received error when trying to retrieve client handle");
System.exit(-1);
}
// initialize the client
cc.initialize(cns, s, null);
...
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic WBEMClientGet aWBEMClientfor a protocol.static String[]Get the names of the supported protocols.
-
Constructor Details
-
WBEMClientFactory
public WBEMClientFactory()
-
-
Method Details
-
getClient
Get aWBEMClientfor a protocol.- Parameters:
pProtocol- The protocol name (e.g. "CIM-XML").- Returns:
- The
WBEMClientimplementation for the protocol specified. - Throws:
IllegalArgumentException-- If the protocol is
nullor empty. - If the protocol is not supported.
- If the protocol is
WBEMException- If the protocol implementation could not be loaded.
-
getSupportedProtocols
Get the names of the supported protocols.- Returns:
- A string array of the supported protocols.
-