Use the following steps to create and deploy a custom advisor to a proxy server. Custom advisor policies allow for more specific determination of target application server availability. Custom advisors are Java code modules written that work within the proxy server to provide information about application server availability to the proxy server selection code.
public AbstractHttpProxyCustomAdvisor(CustomAdvisorConfigObject caConfigObject) {
super(caConfigObject);
}
public boolean isUsable(AdvisableServer aServer) throws CustomAdvisorException;
protected void initialize() {
super.initialize();
}
For more information about the required routines
and the other methods available to a custom advisor, see the application
programming interface (API) reference section of the information center.
From the information center navigation, scroll to the Reference section
and click APIs - Application Programming Interfaces. A list of the
product API specifications displays in alphabetic order.The httpcustomadvisor.jar file can be used as a sample of a custom advisor. This file contains an AbstractHttpProxycustomAdvisor.java class that extends the com.ibm.wsspi.advisor.AbstractCustomAdvisor and implements the isUsable() and initialize() methods.
<advisor-context>
<description>Webbsphere Proxy Demo HTTP Advisor Context</description>
<display-name>Webbsphere Proxy Demo HTTP Advisor Context</display-name>
?
<advisor>
<advisor-name>WebsphereProxyDemoHttpAdvisor</advisor-name>
?
<advisor-class>
com.ibm.ws.proxy.demo.customadvisor.http.HttpProxyCustomAdvisor
</advisor-class>
<description>Demo Websphere Proxy Http Advisor
Implementation</description>
<display-name>Demo Websphere Proxy Http Advisor</display-name>
</advisor>
</advisor-context>
After compiling the custom advisor code, you will need create the advisor-context.xml file. This file is used to identify the code as a custom advisor Java archive (JAR) file when it is imported as an asset and then added as a compilation unit to a business-level application (BLA). When the custom advisor JAR asset is added to a BLA and then targeted to a proxy server, the Content DistributionFramework (CDF) support will distribute and copy all the BLA artifacts of the custom advisor to the appropriate configuration information on the targets specified.
<advisor-name> SomeCustomAdvisor </advisor-name>
<advisor-class> com.ibm.wlm.test.customadvisor.SomeCustomAdvisor </advisor-class>
<description> Some Custom Advisor Description </description>
<display-name> Some display name </display-name>
$AdminTask importAsset {-source C:/proxy/testadvisor.jar -storageType FULL}
$AdminTask createEmptyBLA {-name myBLA}
$AdminTask addCompUnit {-blaID myBLA -cuSourceID assetname=testadvisor.jar,assetversion=1.0 -MapTargets {{.* ProxyServer}} -CustomAdvisorCUOptions
{{"type=Cluster,cellName=yourCellName,clusterName=yourClusterName
,applicationName=myBLA" default default default 1000}}}
$AdminConfig save