com.ibm.commerce.rules.commands
Class InvokePersonalizationRuleServiceCommandJitImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.rules.commands.PersonalizationRuleServiceCommandBase
                    |
                    +--com.ibm.commerce.rules.commands.PersonalizationRuleServiceInteractorCommandBase
                          |
                          +--com.ibm.commerce.rules.commands.InvokePersonalizationRuleServiceCommandJitImpl
All Implemented Interfaces:
ECCommand, InvokePersonalizationRuleServiceCommand, PersonalizationRuleServiceCommand, TaskCommand

public class InvokePersonalizationRuleServiceCommandJitImpl
extends PersonalizationRuleServiceInteractorCommandBase
implements InvokePersonalizationRuleServiceCommand

Provides a "just in time" implementation of InvokePersonalizationRuleServiceCommand. This implementation knows when a rule service's externally-stored configuration has changed and updates its internal list of services accordingly.

If a rule service is externally marked "changed", then the next invocation of that service will first reset the service, activating the changes.

If a rule service is added to the external configuration, then the first invocation of that newly-configured service will cause the server to create the service before invoking it.


Field Summary
static java.lang.String COPYRIGHT
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.rules.commands.InvokePersonalizationRuleServiceCommand
defaultCommandClassName
 
Constructor Summary
InvokePersonalizationRuleServiceCommandJitImpl()
           
InvokePersonalizationRuleServiceCommandJitImpl(com.ibm.commerce.rules.blaze.BlazeRuleServer aPersonalizationRuleServer, RulesSystemDataModel aRulesSystemDataModel, JustInTimeServiceManager aJustInTimeServiceManager)
           
 
Method Summary
protected  void doPerformExecute()
          A primitive method that does the "real work" of the command.
protected  com.ibm.commerce.rules.blaze.BlazeRuleServiceConfiguration getBlazeRuleServiceConfiguration()
          Provides access to a BlazeRuleServiceConfiguration for this rule service.
protected static JustInTimeServiceManager getDefaultJustInTimeServiceManager()
           
 InvocationContext getInvocationContext()
           
protected  JustInTimeServiceManager getJustInTimeServiceManager()
           
protected  RuleServiceConfiguration getRuleServiceConfiguration()
           
protected  java.util.Calendar getRuleServiceConfigurationLastUpdated()
          Answers the question, "When was the current service configuration last updated?!" The default answer, if things go wrong, is "just now".
 void reset()
          This method is called after a command has been executed to reset its states variables.
protected  boolean ruleServiceIsConfigured()
           
protected  boolean ruleServiceIsEnabled()
           
protected  boolean ruleServiceIsOutOfDate()
           
 void setInvocationContext(InvocationContext anInvocationContext)
           
protected  void updateJustInTimeServiceManager()
           
protected  void updatePersonalizationRuleServerForServiceEnabled()
           
 void validateParameters()
          Performs server side parameter checking.
 
Methods inherited from class com.ibm.commerce.rules.commands.PersonalizationRuleServiceInteractorCommandBase
getDefaultPersonalizationRuleServer, getPersonalizationRuleServer
 
Methods inherited from class com.ibm.commerce.rules.commands.PersonalizationRuleServiceCommandBase
doCheckParameter, getDefaultPersonalizationRuleServerName, getDefaultRulesSystemDataModel, getPersonalizationRuleServerName, getRuleServiceKey, getRulesSystemDataModel, getServiceName, performExecute, setServiceName, unsetParameters
 
Methods inherited from class com.ibm.commerce.command.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.rules.commands.PersonalizationRuleServiceCommand
setServiceName
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, performExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

InvokePersonalizationRuleServiceCommandJitImpl

public InvokePersonalizationRuleServiceCommandJitImpl()

InvokePersonalizationRuleServiceCommandJitImpl

public InvokePersonalizationRuleServiceCommandJitImpl(com.ibm.commerce.rules.blaze.BlazeRuleServer aPersonalizationRuleServer,
                                                      RulesSystemDataModel aRulesSystemDataModel,
                                                      JustInTimeServiceManager aJustInTimeServiceManager)
See Also:
PersonalizationRuleServiceCommandBase
Method Detail

doPerformExecute

protected void doPerformExecute()
                         throws ECException
Description copied from class: PersonalizationRuleServiceCommandBase
A primitive method that does the "real work" of the command. Called by performExecute.
Overrides:
doPerformExecute in class PersonalizationRuleServiceCommandBase
See Also:
PersonalizationRuleServiceCommandBase

getBlazeRuleServiceConfiguration

protected com.ibm.commerce.rules.blaze.BlazeRuleServiceConfiguration getBlazeRuleServiceConfiguration()
                                                                                               throws ParameterNotFoundException
Provides access to a BlazeRuleServiceConfiguration for this rule service.

getDefaultJustInTimeServiceManager

protected static JustInTimeServiceManager getDefaultJustInTimeServiceManager()

getInvocationContext

public InvocationContext getInvocationContext()
Specified by:
getInvocationContext in interface InvokePersonalizationRuleServiceCommand

getJustInTimeServiceManager

protected JustInTimeServiceManager getJustInTimeServiceManager()

getRuleServiceConfiguration

protected RuleServiceConfiguration getRuleServiceConfiguration()

getRuleServiceConfigurationLastUpdated

protected java.util.Calendar getRuleServiceConfigurationLastUpdated()
                                                             throws PersonalizationRuleServiceNotFoundException,
                                                                    ParameterNotFoundException
Answers the question, "When was the current service configuration last updated?!" The default answer, if things go wrong, is "just now". This avoids having the system try to reset a service that may not exist or work properly.

reset

public void reset()
Description copied from class: AbstractECCommand
This method is called after a command has been executed to reset its states variables. After the call to reset, we should be able to execute the command again.
Overrides:
reset in class PersonalizationRuleServiceCommandBase
Following copied from class: com.ibm.commerce.rules.commands.PersonalizationRuleServiceCommandBase
See Also:
ECCommand

ruleServiceIsConfigured

protected boolean ruleServiceIsConfigured()
                                   throws ParameterNotFoundException

ruleServiceIsEnabled

protected boolean ruleServiceIsEnabled()
                                throws RulesSystemDataModelException

ruleServiceIsOutOfDate

protected boolean ruleServiceIsOutOfDate()

setInvocationContext

public void setInvocationContext(InvocationContext anInvocationContext)
Specified by:
setInvocationContext in interface InvokePersonalizationRuleServiceCommand

updateJustInTimeServiceManager

protected void updateJustInTimeServiceManager()
                                       throws PersonalizationRuleServiceNotFoundException,
                                              ParameterNotFoundException

updatePersonalizationRuleServerForServiceEnabled

protected void updatePersonalizationRuleServerForServiceEnabled()
                                                         throws ParameterNotFoundException

validateParameters

public void validateParameters()
                        throws ECException
Description copied from interface: ECCommand
Performs server side parameter checking. This method replaces the checkParameters() method in a previous version of the code.

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class PersonalizationRuleServiceCommandBase
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -