public class ContextValueRetriever extends GenericService
For a multisite application that gets profile settings from the current site,
configure useProfile
to false
. For an application
that sets profile values at registration time, for example,
configure useProfile
to true
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected boolean |
mUseProfile |
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
ContextValueRetriever() |
Modifier and Type | Method and Description |
---|---|
void |
doStartService()
In this case, also set the contextValueRetriever value of
our sources to this instance.
|
ContextValueSource[] |
getSources()
Returns property sources.
|
boolean |
isUseProfile()
Indicates if profile properties have already been set to their correct values
or should be assumed to be unreliable.
|
RepositoryItem |
retrieveValue(atg.commerce.util.ContextValueRetrieverArguments pArguments)
Determine the appropriate value for one profile property based on information provided
in an arguments object.
|
protected RepositoryItem |
retrieveValueFromProfile(atg.commerce.util.ContextValueRetrieverArguments pArguments)
Retrieves the value from the Profile, if shouldUseProfile is set to
true . |
protected RepositoryItem |
retrieveValueFromSite(atg.commerce.util.ContextValueRetrieverArguments pArguments)
Retrieves the value from the Site.
|
void |
setSources(ContextValueSource[] pSources)
Sets property sources.
|
void |
setUseProfile(boolean pUseProfile)
Sets property useProfile
|
boolean |
shouldUseProfile(RepositoryItem pProfile)
Indicates if profile properties have already been set to their correct values
or should be ignored.
|
addLogListener, clearAbsoluteNameAndContext, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, isStartServiceComplete, 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, stopService, toString
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
protected boolean mUseProfile
public boolean isUseProfile()
public void setUseProfile(boolean pUseProfile)
public void setSources(ContextValueSource[] pSources)
public ContextValueSource[] getSources()
public RepositoryItem retrieveValue(atg.commerce.util.ContextValueRetrieverArguments pArguments) throws RepositoryException
Customers who need different logic for different profile properties (e.g., catalogs vs. price lists) should configure additional instances of the ContextValueRetriever component and reconfigure references to the original component.
pArguments
- an object containing properties that define possible sources for the value
to be retrievedRepositoryException
protected RepositoryItem retrieveValueFromSite(atg.commerce.util.ContextValueRetrieverArguments pArguments) throws RepositoryException
This method now remains for backwards compatibility reasons. See SiteContextValueSource
for the new approach for determining Site values.
pArguments an object containing properties that define possible sources for the value to be retrieved
RepositoryException
protected RepositoryItem retrieveValueFromProfile(atg.commerce.util.ContextValueRetrieverArguments pArguments) throws RepositoryException
true
.
This method now remains for backwards compatibility reasons. See ProfileContextValueSource
for the new approach for determining Profile values.
pArguments an object containing properties that define possible sources for the value to be retrievedRepositoryException
public boolean shouldUseProfile(RepositoryItem pProfile)
useProfile
property. Override this method to make a determination
based on information stored in the profile.public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting up