atg.endeca.assembler.navigation
Class AbstractMdexResourceResolver

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.GenericReference
              extended by atg.endeca.assembler.navigation.AbstractMdexResourceResolver
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public abstract class AbstractMdexResourceResolver
extends GenericReference

An abstract class for resolving difffernt MdexResource components based upon context. It does this by append a suffix (returned by getMdexResourcePathSuffix()) to a base Nucleus path (specified by the ).

Created: May 24 2012


Field Summary
static java.lang.String CLASS_VERSION
          Class version string from source code control system.
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
AbstractMdexResourceResolver()
           
 
Method Summary
protected  boolean canResolveName()
          Always say we can.
protected  void checkComponentPath()
          Check whether component path is is set.
 java.lang.String getDefaultMdexResourcePath()
          Returns property defaultMdexResourcePath.
 MdexResource getMdexResource()
          Return the specified MdexResource.
 java.lang.String getMdexResourceBasePath()
          Returns property mdexResourceBasePath.
abstract  java.lang.String getMdexResourcePathSuffix(DynamoHttpServletRequest pRequest)
          Get the current suffix as a string.
 boolean getUseRequestNameResolver()
          Returns property useRequestNameResolver
protected  MdexResource resolveMdexResource(DynamoHttpServletRequest pRequest, java.lang.String pNucleusPath)
          Utility method for resolving a nucleus path to an MDEX resource, with logging.
protected  java.lang.Object resolveName()
          Resolves the configured component path.
 void setComponentPath(java.lang.String pComponentPath)
          Sets property ComponentPath
 void setDefaultMdexResourcePath(java.lang.String pDefaultMdexResourcePath)
          Sets property defaultMdexResourcePath.
 void setMdexResourceBasePath(java.lang.String pMdexResourceBasePath)
          Sets property mdexResourceBasePath.
 void setUseRequestNameResolver(boolean pUseRequestNameResolver)
          Sets property useRequestNameResolver
 
Methods inherited from class atg.nucleus.GenericReference
doStartService, getComponentPath, getReference, getResolveCount, incrementResolveCount, isLoggingInfoResolutions, resolveComponent, setLoggingInfoResolutions
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, 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, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string from source code control system.

See Also:
Constant Field Values
Constructor Detail

AbstractMdexResourceResolver

public AbstractMdexResourceResolver()
Method Detail

setUseRequestNameResolver

public void setUseRequestNameResolver(boolean pUseRequestNameResolver)
Sets property useRequestNameResolver

Overrides:
setUseRequestNameResolver in class GenericReference

getUseRequestNameResolver

public boolean getUseRequestNameResolver()
Returns property useRequestNameResolver

Overrides:
getUseRequestNameResolver in class GenericReference

setComponentPath

public void setComponentPath(java.lang.String pComponentPath)
Description copied from class: GenericReference
Sets property ComponentPath

Overrides:
setComponentPath in class GenericReference

setMdexResourceBasePath

public void setMdexResourceBasePath(java.lang.String pMdexResourceBasePath)
Sets property mdexResourceBasePath. The base path for the dynamic MdexResource Nucleus path, to which the result of getPathSuffix should be added.


getMdexResourceBasePath

public java.lang.String getMdexResourceBasePath()
Returns property mdexResourceBasePath. The base path for the dynamic MdexResource Nucleus path, to which the result of getPathSuffix should be added.


setDefaultMdexResourcePath

public void setDefaultMdexResourcePath(java.lang.String pDefaultMdexResourcePath)
Sets property defaultMdexResourcePath. The Nucleus path of default MDEX Resource. Used when key is null, or the matching MdexResource could not be found. A path is used here, to prevent resolving it unnecessarily.


getDefaultMdexResourcePath

public java.lang.String getDefaultMdexResourcePath()
Returns property defaultMdexResourcePath. The Nucleus path of default MDEX Resource. Used when key is null, or the matching MdexResource could not be found. A path is used here, to prevent resolving it unnecessarily.


getMdexResourcePathSuffix

public abstract java.lang.String getMdexResourcePathSuffix(DynamoHttpServletRequest pRequest)
Get the current suffix as a string. Null may be returned if the defaultMdexResource should be used, instead.

Parameters:
pRequest - the current request. May be null.

resolveMdexResource

protected MdexResource resolveMdexResource(DynamoHttpServletRequest pRequest,
                                           java.lang.String pNucleusPath)
Utility method for resolving a nucleus path to an MDEX resource, with logging.

Parameters:
pRequest - the current request.
pNucleusPath - the path to an mdex to resolve.

getMdexResource

public MdexResource getMdexResource()
Return the specified MdexResource. Will attempt to resolve the Nucleus path built from the mdexResourceBasePath + the result of getMdexResourcePathSuffix(), unless getMdexResourcePathSuffix() returns null. Otherwise, will attempt to resolve defaultMdexResourcePath.

Returns:
the resolved MdexResource, or null.

resolveName

protected java.lang.Object resolveName()
Resolves the configured component path. If useRequestNameResolver is true, the path is resolved for the current request. Otherwise, the path is assumed to refer to a globally scoped component.

Overrides:
resolveName in class GenericReference
Returns:
the Object to which the name resolves, or null if the name could not be resolved.

canResolveName

protected boolean canResolveName()
Always say we can. Better an error than fail silently.

Overrides:
canResolveName in class GenericReference
Returns:
true if name resolution should be attempted.

checkComponentPath

protected void checkComponentPath()
                           throws ServiceException
Description copied from class: GenericReference
Check whether component path is is set. If not, throw an exception. Called by doStartService().

Overrides:
checkComponentPath in class GenericReference
Throws:
ServiceException