BEA Systems, Inc.

com.beasys.commerce.axiom.advisor
Class AdvisorBean

java.lang.Object
  |
  +--com.beasys.commerce.axiom.advisor.AdvisorBean

public class AdvisorBean
extends java.lang.Object
implements javax.ejb.SessionBean

Implementation Class for the Advisor Bean. The advisor bean makes recommendations for advise requests. To get recommendations, first create a request template for the type of request you want to make by calling the advisor's createRequestTemplate method, then fill out the template with the required information, and then call the advisor's advise() method.

See Also:
Serialized Form

Field Summary
protected static boolean debug
           
 
Constructor Summary
AdvisorBean()
          Default Constructor
 
Method Summary
 AdviceResults advise(AdviceRequest adviceRequest)
          This method makes recommendations based the AdviceRequest passed in.
 AdviceRequest createRequestTemplate(java.lang.String theKindOfAdvice)
          This method creates an AdviceRequest template for the kind of advice request passed in.
 void ejbActivate()
          Activates the bean.
 void ejbCreate()
          Creates a bean instance.
 void ejbPassivate()
          Passivates the bean.
 void ejbRemove()
          Removes the bean.
 void setSessionContext(javax.ejb.SessionContext sessionContext)
          Sets the session context for the bean instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected static final boolean debug
Constructor Detail

AdvisorBean

public AdvisorBean()
Default Constructor
Method Detail

advise

public AdviceResults advise(AdviceRequest adviceRequest)
                     throws java.lang.IllegalArgumentException,
                            AdvisorException,
                            AdviceRequestValidationException,
                            java.rmi.RemoteException
This method makes recommendations based the AdviceRequest passed in.
Parameters:
adviceRequest - The advice request for which to make a recommendation.
Returns:
AdviceResults The advice results which contain the recommendations based on the type of request made.
Throws:
java.lang.IllegalArgumentException - Thrown if the adviceRequest parameter is null or an unsupported type.
AdvisorException - thrown on an error when processing the request.
AdviceRequestValidationException - thrown on an error when validating the request.
java.rmi.RemoteException - thrown on a communication error.

createRequestTemplate

public AdviceRequest createRequestTemplate(java.lang.String theKindOfAdvice)
                                    throws java.lang.IllegalArgumentException,
                                           AdvisorException,
                                           java.rmi.RemoteException
This method creates an AdviceRequest template for the kind of advice request passed in.
Parameters:
theKindOfAdvice - The name of the kind of advice which is used to create the template.
Returns:
AdviceRequest A advice request template. The caller is responsible for setting the template data before calling the Advisor.advise() method.
Throws:
java.lang.IllegalArgumentException - Thrown if the parameters are null or an unsupported type.
AdvisorException - thrown on an error when creating the template.
java.rmi.RemoteException - thrown on a communication error.

ejbActivate

public void ejbActivate()
Activates the bean.
Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
Creates a bean instance.
Throws:
javax.ejb.CreateException - Thrown if unable to create the ejb

ejbPassivate

public void ejbPassivate()
Passivates the bean.
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

ejbRemove

public void ejbRemove()
Removes the bean.
Specified by:
ejbRemove in interface javax.ejb.SessionBean

setSessionContext

public void setSessionContext(javax.ejb.SessionContext sessionContext)
Sets the session context for the bean instance.
Specified by:
setSessionContext in interface javax.ejb.SessionBean
Parameters:
sessionContext - The session context

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved