Advislet Interface

com.bea.p13n.advisor
Advislet Interface

public interface Advislet

    extends AdvisletChainElement

This interface is the common interface for all Advislets. An Advislet is a simple, pluggable piece of personalization technology that can be declaratively chained with other Advislets though the AdvisletRegistry.

The Advisor uses the AdvisletRegistry to select Advislets based on the URI of an incoming AdviceRequest.

Advislets are deployed and bound to a URI through the AdvisletRegistry configuration file (advislet-registry.xml).


All Known Implementing Classes
AbstractAdvislet
All Superinterfaces
AdvisletChainElement

Method Summary

public Advice
getAdvice(AdviceRequest request)
Makes recommendations based on the AdviceRequest passed in.
public Object[]
getRequiredAttributes()
Returns an array of required attributes for the advislet.
public void
validateAdviceRequest(AdviceRequest request)
Allows for custom AdviceRequest validation logic in addition to the required attribute checking performed by the Advisor.
 
Methods from interface com.bea.p13n.advisor.AdvisletChainElement
getMetadata, initialize
   

Method Detail

getAdvice(AdviceRequest) Method

public Advice getAdvice(AdviceRequest request)
throws IllegalArgumentException, AdvisorException
Makes recommendations based on the AdviceRequest passed in.

Parameters

request
The advice request for which to make a recommendation.

Returns

The advice which contain the recommendations based on the type of request made.

Exceptions

IllegalArgumentException
thrown if the adviceRequest parameter is null or if it is an unsupported type.
AdvisorException
thrown on an error when processing the request.

getRequiredAttributes() Method

public Object[] getRequiredAttributes()
Returns an array of required attributes for the advislet. The array contains pairs of items: even items are attribute names while odd items are the Class for the item. This information is used by the Advisor to ensure Advislets are not invoked with invalid parameters. Overide the validateAdviceRequest method to perform additional processing above and beyond attribute type checking.

Returns

an array that contains the attributes required by the Advislet.

validateAdviceRequest(AdviceRequest) Method

public void validateAdviceRequest(AdviceRequest request)
throws IllegalArgumentException
Allows for custom AdviceRequest validation logic in addition to the required attribute checking performed by the Advisor.

Parameters

request
the request to validate.

Exceptions

IllegalArgumentException
thrown if the adviceRequest parameter is null or if it is an unsupported type.