Custom advisors
are written in the Java language. A custom advisor
extends the com.ibm.wsspi.advisor.AbstractCustomAdvisor class in the
proxy.jar file that is included with WebSphere
® Application
Server. Custom advisors use the defined methods of the AbstractCustomAdvisor
class to obtain the information about the advisor. A custom advisor
also must implement the following elements:
The initialize method is called after the AbstractCustomAdvisor
construction, but before the isUsable method is called. This process
allows the custom advisor to perform any additional steps after the
base class completes initialization, but before the isUsable method
is called, which ensures that the initialize method is only called
once. If overridden, then the initialize() method must call the super.intitialize
method, for example:
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.
Sample httpcustomadvisor.jar file:<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>