When the user starts your action, the vSphere Web Client generates an ActionInvocationEvent using the ID you specified using the
<uid> property in the
ActionSpec object in your extension definition. The vSphere Web Client then instantiates the command class you specified in the
<command> property. Your command class must contain a method annotated to handle the
ActionInvocationEvent that is generated when the action is started. A single command class can contain handler methods for multiple actions, if those methods have the necessary annotations.
You annotate a method to handle an ActionInvocationEvent by using the
[RequestHandler] metadata tag when you declare the method. In the
[RequestHandler] tag, you must specify the
<uid> property for the action to handle. To annotate a method to handle the “Create Chassis” command in
Example: Example Action Set Extension, you must include the following
[RequestHandler] tag in your method declaration.
Example 7-2, on page 68, shows an example command class. In the example, the
ChassisCommand class contains a handler method for each of the actions defined in
Example: Example Action Set Extension.
In the example, the onCreateChassisActionInvocation and
onEditChassisActionInvocation methods are annotated to handle the actions defined in the action set in
Example: Example Action Set Extension. The actual action operations are performed by an imported Java service. In
Example: Example Command Class,
ChassisServiceProxy refers to a proxy class for a Java service that performs the action operations. See
Performing Action Operations on the vSphere Environment.