atg.nucleus
Class GenericReference

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.GenericReference
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 class GenericReference
extends GenericService

When this service is started it will resolve the component through the componentPath property and bind that new object into the name of this service.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
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
GenericReference()
          Constructs an instanceof GenericReference
 
Method Summary
protected  boolean canResolveName()
          Whether resolveName should be invoked.
protected  void checkComponentPath()
          Check whether component path is is set.
 void doStartService()
          This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values.
 java.lang.String getComponentPath()
          Returns property ComponentPath
 java.lang.Object getReference()
          Returns property Reference
 int getResolveCount()
          Get the number of times resolution has been attempted.
 boolean getUseRequestNameResolver()
          Returns property useRequestNameResolver
 int incrementResolveCount()
          Increment the resolve count and return the incremented value.
 boolean isLoggingInfoResolutions()
          Returns property loggingInfoResolutions.
protected  java.lang.Object resolveComponent(java.lang.String pComponentName)
          Resolves the configured component path.
protected  java.lang.Object resolveName()
          Resolves the configured component path.
 void setComponentPath(java.lang.String pComponentPath)
          Sets property ComponentPath
 void setLoggingInfoResolutions(boolean pLoggingInfoResolutions)
          Sets property loggingInfoResolutions.
 void setUseRequestNameResolver(boolean pUseRequestNameResolver)
          Sets property useRequestNameResolver
 
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 java.lang.String CLASS_VERSION
Class version string

Constructor Detail

GenericReference

public GenericReference()
Constructs an instanceof GenericReference

Method Detail

setComponentPath

public void setComponentPath(java.lang.String pComponentPath)
Sets property ComponentPath


getComponentPath

public java.lang.String getComponentPath()
Returns property ComponentPath


setUseRequestNameResolver

public void setUseRequestNameResolver(boolean pUseRequestNameResolver)
Sets property useRequestNameResolver


getUseRequestNameResolver

public boolean getUseRequestNameResolver()
Returns property useRequestNameResolver


setLoggingInfoResolutions

public void setLoggingInfoResolutions(boolean pLoggingInfoResolutions)
Sets property loggingInfoResolutions. Whether we are using logInfo() to log component resolutions. Defaults to true.


isLoggingInfoResolutions

public boolean isLoggingInfoResolutions()
Returns property loggingInfoResolutions. Whether we are using logInfo() to log component resolutions. Defaults to true.


getReference

public java.lang.Object getReference()
Returns property Reference


getResolveCount

public int getResolveCount()
Get the number of times resolution has been attempted.


incrementResolveCount

public int incrementResolveCount()
Increment the resolve count and return the incremented value.


doStartService

public void doStartService()
                    throws ServiceException
Description copied from class: GenericService
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. The Service should override this method to start any processes it requires.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

resolveComponent

protected java.lang.Object resolveComponent(java.lang.String pComponentName)
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.

Parameters:
pComponentPath - the component path to resolve.
Returns:
the Object to which the name resolves, or null if the name could not be resolved.

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.

Returns:
the Object to which the name resolves, or null if the name could not be resolved.

canResolveName

protected boolean canResolveName()
Whether resolveName should be invoked. Returns false if componentPath property is null.

Returns:
true if name resolution should be attempted.

checkComponentPath

protected void checkComponentPath()
                           throws ServiceException
Check whether component path is is set. If not, throw an exception. Called by doStartService().

Throws:
ServiceException