© 2002 BEA Systems, Inc.


com.bea.p13n.advisor
Class AbstractAdvislet

java.lang.Object
  |
  +--com.bea.p13n.advisor.AbstractAdvislet
Direct Known Subclasses:
CatalogQueryAdvisletImpl, ContentQueryAdvisletImpl, RulesAdvisletImpl

public abstract class AbstractAdvislet
extends java.lang.Object
implements Advislet, AdviceRequestConstants, AdviceConstants

An abstract class which provides some default method implementations for classes wishing to implement the Advislet interface.


Field Summary
protected  Metadata advisletMetadata
          The metadata for the Advislet
protected  Advisor advisor
          The Advisor associated with this Advislet instance.
protected  java.util.Map parametersMap
          The parameters Map for the Advislet
 
Constructor Summary
AbstractAdvislet(Advisor advisor, Metadata advisletMetadata)
          Constructs a new AbstractAdvislet associated with the Advisor supplied.
 
Method Summary
 Advice getAdvice(AdviceRequest request)
           
protected  Advisor getAdvisor()
          Gets the Advisor associated with this Advislet.
 Metadata getMetadata()
          Returns the metadata for the Advislet.
 java.lang.Object[] getRequiredAttributes()
           
 boolean initialize(java.util.Map parameters, java.lang.Object parameterDocument)
          Initializes this with the given parameters and a parameterDocument.
 java.lang.String toString()
          Returns a String representation of this.
 void validateAdviceRequest(AdviceRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

advisor

protected Advisor advisor
The Advisor associated with this Advislet instance.

advisletMetadata

protected Metadata advisletMetadata
The metadata for the Advislet

parametersMap

protected java.util.Map parametersMap
The parameters Map for the Advislet
Constructor Detail

AbstractAdvislet

public AbstractAdvislet(Advisor advisor,
                        Metadata advisletMetadata)
Constructs a new AbstractAdvislet associated with the Advisor supplied.
Method Detail

initialize

public boolean initialize(java.util.Map parameters,
                          java.lang.Object parameterDocument)
                   throws AdvisorException
Initializes this with the given parameters and a parameterDocument.

Parameters:
parameters - A map containing key-value pairs.
parameterDocument - An Object representing a parameter document.
Returns:
returns true if this operation is successful, otherwise returns false.
Throws:
AdvisorException - If an error occurs during initialization process.

getAdvisor

protected Advisor getAdvisor()
Gets the Advisor associated with this Advislet.

Returns:
The Advisor set as the parent.

getMetadata

public Metadata getMetadata()
Returns the metadata for the Advislet.

Returns:
the metadata for the Advislet.

getAdvice

public Advice getAdvice(AdviceRequest request)
                 throws java.lang.IllegalArgumentException,
                        AdvisorException
Specified by:
getAdvice in interface Advislet


validateAdviceRequest

public void validateAdviceRequest(AdviceRequest request)
                           throws java.lang.IllegalArgumentException
Specified by:
validateAdviceRequest in interface Advislet


getRequiredAttributes

public java.lang.Object[] getRequiredAttributes()
Specified by:
getRequiredAttributes in interface Advislet


toString

public java.lang.String toString()
Returns a String representation of this.

Returns:
a String representation of this.
Overrides:
toString in class java.lang.Object

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved