@Service(requiredProperties="definitionFile") public class ActorChainService extends GenericService implements VariantActor
If you want to use custom getActorContextFactory() and getModelMapFactory() instead
of the OTB factories, you can configure them in this component. These factories are used use the
nest chains as well.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
static java.lang.String |
ERROR_ACTOR_CONTEXT_OR_MODEL_MAP_NULL |
static java.lang.String |
ERROR_ACTOR_NAME_NULL |
static java.lang.String |
ERROR_ACTOR_OR_MESSAGE |
static java.lang.String |
ERROR_ACTOR_VALUE_NULL |
static java.lang.String |
ERROR_EXPECTED_MAP_VALUE |
static java.lang.String |
ERROR_REQUEST_NULL |
protected ActorContextFactory |
mActorContextFactory |
protected atg.service.actor.ActorTemplate |
mActorTemplate |
protected int |
mDebugLevel |
protected atg.xml.XMLFile |
mDefinitionFile |
protected java.lang.String |
mJAXBContextPath |
protected ModelMapFactory |
mModelMapFactory |
SERVICE_INFO_KEYDEFAULT_LOG_TRACE_STATUSDEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS| Constructor and Description |
|---|
ActorChainService() |
| Modifier and Type | Method and Description |
|---|---|
void |
act(ActorContext pActorContext,
ModelMap pModelMap)
This method takes a non-null ActorContext and a non-null ModelMap.
|
protected javax.servlet.Servlet |
createAdminServlet()
Create the administration servlet.
|
protected atg.service.actor.ObjectFactory |
createObjectFactoryInstance()
This method creates an actor framework
ObjectFactory instance. |
void |
debug(java.lang.String pMsg,
int pLevel)
Log a debug message if the
debugLevel is greater
than or equal to the specified level |
void |
doStartService()
This method is called after a Service has been created, placed into the
naming hierarchy, and initialized with its configured property values.
|
java.util.List<atg.service.actor.ActorChain> |
getActorChains() |
atg.service.actor.ActorChainValidationService |
getActorChainValidationService() |
ActorContextFactory |
getActorContextFactory()
Returns the actorContextFactory
|
int |
getDebugLevel()
Returns the level of detail to provide when
loggingDebug is
true. |
java.lang.String |
getDefaultActorChainId()
This method calls
ActorTemplate.computeDefaultActorChainId() to get the
default chain id for this actor chain service. |
atg.xml.XMLFile |
getDefinitionFile()
Returns the definitionFile
|
protected java.lang.String |
getJAXBContextPath()
Returns the jAXBContextPath
|
ModelMapFactory |
getModelMapFactory()
Returns the modelMapFactory
|
protected java.util.List<Actor> |
getSortedActors(ActorContext pActorContext,
java.util.List<Actor> pUnsortedActors)
This method takes unsorted actors and sorts them based on the depends and
dependsIfPresent xml definitions of an actor definition.
|
protected void |
initializeActorTemplate()
This method calls
unmarshal(XMLFile) to un-marshal the xml file and initializes
actorTemplate property. |
boolean |
isEnableValidateComponentExists()
Should validation check if the chains in this component that contain component actors reference components that exist?
|
boolean |
isEnableValidateComponentInputs()
Should validation check if the chains in this actor that contain component have valid inputs
|
boolean |
isEnableValidateComponentMethod()
Should validation check if the chains in this actor that contain components with methods have a valid method
|
boolean |
isEnableValidateDefaultChainId()
Should validation check for a valid default chain id
|
boolean |
isEnableValidateDropletExists()
Should validation check if the chains in this actor that contain droplet actors reference droplet that exist?
|
boolean |
isEnableValidateDropletInputsUseTernaryOperator()
Should validation check if the droplet inputs use ternary operator?
|
boolean |
isEnableValidateFormInputs()
Should validation check if the chains in this actor that contain form actors reference inputs that exist?
|
boolean |
isEnableValidateFoward()
Should validation check if the chains in this actor that contain form actors have a success or error URL that is handling forward/redirect incorrectly?
|
boolean |
isEnableValidateHandleMethodExists()
Should validation check that handle method exists
|
boolean |
isEnableValidateInputsExist()
Should validation check that inputs exist
|
boolean |
isEnableValidateNestedActorExists()
Should validation check if the chains in this actor that contain nested actors reference actors that exist?
|
boolean |
isEnableValidateRegistration()
Should validation check if the chains in this component are registered for REST access? Validation logs an info if not registered.
|
boolean |
isEnableValidateSuccessErrorUrlExist()
Should validation check if the chains in this actor that contain form actors have a success and error URL?
|
boolean |
isEnableXmlValidation()
Returns property enableXmlValidation.
|
void |
reinitializeActorTemplate()
If the
getDefinitionFile() has been modified, then this method calls initializeActorTemplate()
to initialize the actor template |
void |
setActorChainValidationService(atg.service.actor.ActorChainValidationService pActorChainValidationService) |
void |
setActorContextFactory(ActorContextFactory pActorContextFactory)
Sets the actorContextFactory
|
protected void |
setActorTemplate(atg.service.actor.ActorTemplate pActorTemplate)
Sets the actorTemplate
|
void |
setDebugLevel(int pDebugLevel)
Sets the level of detail to provide when
loggingDebug is
true. |
void |
setDefinitionFile(atg.xml.XMLFile pDefinitionFile)
Sets the definitionFile
|
void |
setEnableValidateComponentExists(boolean pEnableValidateComponentExists)
Should validation check if the chains in this component that contain component actors reference components that exist?
|
void |
setEnableValidateComponentInputs(boolean pEnableValidateComponentInputs)
Should validation check if the chains in this actor that contain component have valid inputs
|
void |
setEnableValidateComponentMethod(boolean pEnableValidateComponentMethod)
Should validation check if the chains in this actor that contain components with methods have a valid method
|
void |
setEnableValidateDefaultChainId(boolean pEnableValidateDefaultChainId)
Should validation check for a valid default chain id
|
void |
setEnableValidateDropletExists(boolean pEnableValidateDropletExists)
Should validation check if the chains in this actor that contain droplet actors reference droplet that exist?
|
void |
setEnableValidateDropletInputsUseTernaryOperator(boolean pEnableValidateDropletInputsUseTernaryOperator)
Should validation check if the droplet inputs use ternary operator?
|
void |
setEnableValidateFormInputs(boolean pEnableValidateFormInputs)
Should validation check if the chains in this actor that contain form actors reference inputs that exist?
|
void |
setEnableValidateFoward(boolean pEnableValidateFoward)
Should validation check if the chains in this actor that contain form actors have a success or error URL that is handling forward/redirect incorrectly?
|
void |
setEnableValidateHandleMethodExists(boolean pEnableValidateHandleMethodExists)
Should validation check for that handle method exists
|
void |
setEnableValidateInputsExist(boolean pEnableValidateInputsExist)
Should validation check for that inputs exist
|
void |
setEnableValidateNestedActorExists(boolean pEnableValidateNestedActorExists)
Should validation check if the chains in this actor that contain nested actors reference actors that exist?
|
void |
setEnableValidateRegistration(boolean pEnableValidateRegistration)
Should validation check if the chains in this component are registered for REST access? Validation logs an info if not registered.
|
void |
setEnableValidateSuccessErrorUrlExist(boolean pEnableValidateSuccessErrorUrlExist)
Should validation check if the chains in this actor that contain form actors have a success and error URL?
|
void |
setEnableXmlValidation(boolean pEnableXmlValidation)
Sets property enableXmlValidation.
|
protected void |
setJAXBContextPath(java.lang.String pJAXBContextPath)
Sets the jAXBContextPath
|
void |
setModelMapFactory(ModelMapFactory pModelMapFactory)
Sets the modelMapFactory
|
protected atg.service.actor.ActorTemplate |
unmarshal(atg.xml.XMLFile pXMLFile)
This method un-marshals actor xml definitions into
actorTemplate property. |
addLogListener, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopServicevlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarningpublic static java.lang.String CLASS_VERSION
public static final java.lang.String ERROR_ACTOR_CONTEXT_OR_MODEL_MAP_NULL
public static final java.lang.String ERROR_REQUEST_NULL
public static final java.lang.String ERROR_ACTOR_NAME_NULL
public static final java.lang.String ERROR_ACTOR_VALUE_NULL
public static final java.lang.String ERROR_ACTOR_OR_MESSAGE
public static final java.lang.String ERROR_EXPECTED_MAP_VALUE
protected ActorContextFactory mActorContextFactory
protected ModelMapFactory mModelMapFactory
protected atg.service.actor.ActorTemplate mActorTemplate
protected atg.xml.XMLFile mDefinitionFile
protected java.lang.String mJAXBContextPath
protected int mDebugLevel
public ActorContextFactory getActorContextFactory()
public void setActorContextFactory(ActorContextFactory pActorContextFactory)
pActorContextFactory - the actorContextFactory to setpublic ModelMapFactory getModelMapFactory()
public void setModelMapFactory(ModelMapFactory pModelMapFactory)
pModelMapFactory - the modelMapFactory to setpublic void setEnableXmlValidation(boolean pEnableXmlValidation)
public boolean isEnableXmlValidation()
protected void setActorTemplate(atg.service.actor.ActorTemplate pActorTemplate)
pActorTemplate - the actorTemplate to setpublic atg.xml.XMLFile getDefinitionFile()
public void setDefinitionFile(atg.xml.XMLFile pDefinitionFile)
pDefinitionFile - the definitionFile to setprotected java.lang.String getJAXBContextPath()
This value is used to set the JAXB Context.
protected void setJAXBContextPath(java.lang.String pJAXBContextPath)
This value is used to set the JAXB Context.
pJAXBContextPath - the jAXBContextPath to setpublic void setDebugLevel(int pDebugLevel)
loggingDebug is
true. Higher levels mean more debugging information is provided.
Any vallue less than 3 provides basic information. 3 adds more detail, 5 a little
more, and 10 is the most verbose.pDebugLevel - new value to setpublic int getDebugLevel()
loggingDebug is
true. Higher levels mean more debugging information is provided.
Any vallue less than 3 provides basic information. 3 adds more detail, 5 a little
more, and 10 is the most verbose.debugLevelpublic atg.service.actor.ActorChainValidationService getActorChainValidationService()
ActorChainValidationServicepublic void setActorChainValidationService(atg.service.actor.ActorChainValidationService pActorChainValidationService)
ActorChainValidationServicepublic java.util.List<atg.service.actor.ActorChain> getActorChains()
public boolean isEnableValidateDefaultChainId()
public void setEnableValidateDefaultChainId(boolean pEnableValidateDefaultChainId)
public boolean isEnableValidateInputsExist()
public void setEnableValidateInputsExist(boolean pEnableValidateInputsExist)
public boolean isEnableValidateHandleMethodExists()
public void setEnableValidateHandleMethodExists(boolean pEnableValidateHandleMethodExists)
public boolean isEnableValidateRegistration()
public void setEnableValidateRegistration(boolean pEnableValidateRegistration)
public boolean isEnableValidateComponentExists()
public void setEnableValidateComponentExists(boolean pEnableValidateComponentExists)
public boolean isEnableValidateFormInputs()
public void setEnableValidateFormInputs(boolean pEnableValidateFormInputs)
public boolean isEnableValidateDropletExists()
public void setEnableValidateDropletExists(boolean pEnableValidateDropletExists)
public boolean isEnableValidateSuccessErrorUrlExist()
public void setEnableValidateSuccessErrorUrlExist(boolean pEnableValidateSuccessErrorUrlExist)
public boolean isEnableValidateFoward()
public void setEnableValidateFoward(boolean pEnableValidateFoward)
public boolean isEnableValidateDropletInputsUseTernaryOperator()
public void setEnableValidateDropletInputsUseTernaryOperator(boolean pEnableValidateDropletInputsUseTernaryOperator)
public boolean isEnableValidateComponentInputs()
public void setEnableValidateComponentInputs(boolean pEnableValidateComponentInputs)
public boolean isEnableValidateComponentMethod()
public void setEnableValidateComponentMethod(boolean pEnableValidateComponentMethod)
public boolean isEnableValidateNestedActorExists()
public void setEnableValidateNestedActorExists(boolean pEnableValidateNestedActorExists)
public void doStartService()
throws ServiceException
This method calls initializeActorTemplate() to initialize actor template data.
doStartService in class GenericServiceServiceException - if the Service had a problem starting upinitializes actor templateprotected javax.servlet.Servlet createAdminServlet()
createAdminServlet in class GenericServicepublic void act(ActorContext pActorContext, ModelMap pModelMap) throws ActorException
Configuration.isReinitializeActorTempleOnFileModification(). If it is configured to
re-initialize, then this method calls reinitializeActorTemplate() to
reinitialize actor template.
ActorUtils.__ATG_ACTOR_CHAIN_SERVICE__
b) ActorUtils.__ATG_ACTOR_CONTEXT_FACTORY__
c) ActorUtils.__ATG_MODEL_MAP_FACTORY__
d) ActorUtils#__ATG_ACTOR_MODEL_MAP__
ActorTemplate.determineActorChain(ActorContext) to get the
chain that needs to be executed and calls ActorChain.act(ActorContext, ModelMap) to execute the chain.
act in interface ActorpActorContext - The ActorContext is a map where attributes can be passed into the actor.pModelMap - A map that contains modelsActorException - If there is any error, this exception is thrown.Configuration#isReinitializeActorTempleOnFileModification()},
reinitializeActorTemplate(),
ActorUtils.putActorChainService(ActorContext, ActorChainService),
ActorUtils.putActorContextFactory(ActorContext, ActorContextFactory),
ActorUtils.putActorModelMapFactory(ActorContext, ModelMapFactory),
ActorTemplate.determineActorChain(ActorContext),
ActorChain.act(ActorContext, ModelMap)protected atg.service.actor.ObjectFactory createObjectFactoryInstance()
throws ActorException
ObjectFactory instance.
If you extend any actor JAXB Beans, then you need to extend this method.
ActorExceptionprotected atg.service.actor.ActorTemplate unmarshal(atg.xml.XMLFile pXMLFile)
throws ActorException
actorTemplate property.
The JAXB context is set using the getJAXBContextPath(). The ObjectFactory
instance is created using createObjectFactoryInstance(). After setting up the required JAXB settings
the getDefinitionFile() XML file is un-marshaled.
ActorExceptiongetJAXBContextPath(),
createObjectFactoryInstance()public java.lang.String getDefaultActorChainId()
throws ActorException
ActorTemplate.computeDefaultActorChainId() to get the
default chain id for this actor chain service.
getDefaultActorChainId in interface VariantActorActorExceptionActorTemplate.computeDefaultActorChainId()public void reinitializeActorTemplate()
throws ActorException
getDefinitionFile() has been modified, then this method calls initializeActorTemplate()
to initialize the actor template
ActorExceptionIf the XML file is modified, then the actorTemplate property is reinitialized.,
Initializes the actorTemplate property.protected void initializeActorTemplate()
throws ActorException
unmarshal(XMLFile) to un-marshal the xml file and initializes
actorTemplate property.
ActorException#unmarshal(XMLFile)}protected java.util.List<Actor> getSortedActors(ActorContext pActorContext, java.util.List<Actor> pUnsortedActors) throws ActorException
pActorContext - pUnsortedActors - ActorExceptionBaseAbstractActor#addSortedActors(ActorContext, List, List)} Adds the depends, dependsIfPresent actorspublic void debug(java.lang.String pMsg,
int pLevel)
debugLevel is greater
than or equal to the specified levelpMsg - message to logpLevel - debug level of message