Examples
This section provides examples on how to use public APIs using JMX and WS-MAN. Java 6 is required to compile or use each of these examples. For more examples, refer to the SDK that is shipped with Sun xVM Ops Center.
| Example | Description | Code |
|---|---|---|
| Basic client example using JMX | This example demonstrates the basic usage of the JMX Messaging Protocol (JMXMP) connector with JAVA/JMX technology. This example does not require any external JARs except Java and JDMK. This example can be run against both Sun xVM Server or Sun xVM Ops Center. This example performs the following functions:
|
BasicClient.java |
| Basic client example using WS-MAN | This example performs the same functions as the previous example. However, this example uses WS-MAN connector with JAVA/JMX technology. This example also can be run against both Sun xVM Server or Sun xVM Ops Center. This example provides a shell script (simple_client) to launch it easily. The usage of this script is: simple_client <username> <password> [<remote target>] |
SimpleClient.java |
| Domain model client example using WS-MAN | This example demonstrates the usage of the direct access to the read-only copy of the domain model. This example can be run against both Sun xVM Server or Sun xVM Ops Center. This example performs the following functions:
|
DomainModelClient.java |
| Discovery and agent provisioning example using WS-MAN | This example performs discovery, installs and uninstalls an agent, and deletes gear. | OCProvisionClient.java Utils.java |



