An MBean interface is the first action-specific component that you need to write. It includes the methods that you implement at a later step
The MBean interface that you are about to write must meet the following requirements:
• |
Extends the BaseActionMBean class. |
• |
getParametersMetadata(). A method for providing meta-data used by the browser interface to enable the end-user to supply input. This allows the user to provide the context by connecting it with a Foglight registry variable, a rule-level variable, or a custom value. |
• |
invoke(). A method that implements the action behavior. |
Start by editing the sample file, ExampleActionMBean.java.
1 |
In your directory structure, locate the ExampleActionMBean.java file and change its name so that the file name includes the action name configured in the build. properties file. For more information about configuring this file, see Configuring Build Properties . |
3 |
If you previously changed the package name from its default value, com.sample.action while configuring build.properties, in the newly-renamed .java file, update the package declaration that appears at the beginning of the file. |
You can now proceed to write a class that implements the newly-defined MBean interface. For more information, see Implementing the MBean Interface.
In the implementation or the MBean interface you will define the behavior of all the methods that appear in the interface.
The implementation of the MBean interface that you are about to write must include the definitions of the mandatory getParametersMetadata() and invoke() methods, along with the definitions for any other action-specific method that appear in the interface. For more information about getParametersMetadata() and invoke(), see Writing the MBean Interface .
1 |
In your directory structure, locate the ExampleAction.java file and change its name so that the file name includes the action name configured in the build. properties file. For more information about configuring this file, see Configuring Build Properties . |
3 |
If you previously changed the package name from its default value, com.sample.action while configuring build.properties, in the newly-renamed .java file, update the package declaration that appears at the beginning of the file. |
5 |
Implement the behavior of the mandatory getParametersMetadata() and invoke() methods, along with any action-specific other methods that are declared in the MBean interface. |
You can now proceed to build you actions and integrate them with Foglight. For more information, see Integrating Custom Actions with Foglight.
The build process is comprised of a series of tasks that compile and package your JavaTM code. Those tasks are described in the build.xml file and are executed by an ANT process. For a sample listing of the build.xml file, see build.xml .
1 |
The build process compiles your Java code and creates a build sub-directory in your directory structure. In that directory, you will find a cartridge file (.car) that contains the custom action. The CAR file is a packaging artifact that you will use to integrate the custom action. It is located at the root of the build directory.
The following table illustrates the structure the build directory and provides additional information about the directory contents where necessary.
Contains the deliverable CAR file along with some temporary build files. | ||||||||||
The file name uses the following syntax conventions:
For example: MyCustomAction-1_0_0.car. For more information about the settings in the build.properties file, see Configuring Build Properties . | ||||||||||
You have successful compiled and packaged the custom action code. From here, you can now proceed to integrate your custom action with Foglight. For complete information, see Integrating Custom Actions with Foglight .
The build process produces the cartridge file (CAR) that you can use to integrate the custom action with Foglight®. The cartridge file can be installed and managed in Foglight as any other cartridge file. You can install and enable the cartridge either through the browser interface or the command line using fglcmd’s cartridge:install fglcmd command. For details, see Installing CAR Files .
© ALL RIGHTS RESERVED. 使用条款 隐私 Cookie Preference Center