Creating custom requests

To create a custom request, complete the following steps:
  1. Edit the DC_home/runtime/app_server_version.node_name.server_name/custom/toolkit_custom.properties file and uncomment the following line:
    am.camtoolkit.gpe.customxml.custom=/opt/IBM/itcam/WebSphere/DC/itcamdc
    					/etc/custom_requests.xml
    You can specify a different location and file name.
    Note: If the custom_request.xml file resides in the DC_home/runtime/app_server_version.node_name.server_home/custom/ directory, then you can specify the simple file name, without having to specify the fully qualified path.
  2. Create or edit the custom_requests.xml - it is typically easier to make a copy of the file and edit it to add the custom request definitions. The following example shows an XML specification for a custom request:
    <gpe>
      <bci>
        <customEdgeRequests>
    
          <edgeRequest>
             <requestName>MonteCarlo</requestName>
                   <Matches>com.myco.investment.modeler.Simulator</Matches>
                   <type>application</type>
             <methodName>executeMonteCarlo</methodName>
           </edgeRequest>    
              
         </customEdgeRequests>       
      </bci>
    </gpe> 
    The following table explains the XML elements in the custom_requests.xml file.
    Table 1. XML elements in custom_requests.xml
    Tag Name Description
    edgeRequest Identifies one or more application methods that are to be monitored for custom request processing. By modifying the requestName, Matches, type, and methodName tags within the edgeRequest tag, you can customize the selection. Each edgeRequest tag must contain exactly one methodName tag, and one or more Matches tags. Multiple edgeRequest tags can be specified.
    requestName Defines a unique name for this request. The request name is displayed in the L1 or L2 trace entry that is produced when one of the methods identified by this custom request runs.
    Matches Identifies a class or classes that contain the methods that are to be defined as custom requests. Multiple Matches tags can be present within a single edgeRequest tag.
    type Indicates whether the classes specified are loaded by system or application class loader. If the classes are present within an application EAR file, then the type is “application”. However, in rare cases, the classes might be present in JAR files specified in ws.ext.dir, system class path or even in bootstrap class path. In such cases the type is “system”.
    methodName Identifies the names of the methods within one of the classes identified by the Matches tag that are to be monitored for custom request processing. One methodName tag can be specified in each edgeRequest tag.
    The Matches and the methodName tags can include wildcard characters. The following list is a summary of the wildcard functionality:
    • Asterisk (*) stands for zero or more occurrences of any character when used by itself. When embedded within a sequence of characters, for example, java.*.String, it matches zero or more occurrences of any character except the package separator (.).
    • Two periods (..) can be used to specify all subpackages, for example, java..String matches java.lang.String. It matches any sequence of characters that starts and ends with the package separator (.).
  3. After defining the custom requests, the application server JVM needs to be recycled for them to take effect.