© 2005 BEA Systems, Inc.

com.bea.p13n.advisor
Interface Advislet

All Superinterfaces:
AdvisletChainElement
All Known Implementing Classes:
AbstractAdvislet

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).


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

Method Detail

getAdvice

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.
Throws:
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

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

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.
Throws:
IllegalArgumentException - thrown if the adviceRequest parameter is null or if it is an unsupported type.

© 2005 BEA Systems, Inc.

Copyright © 2005 BEA Systems, Inc. All Rights Reserved