atg.distributor
Class SenderResourcePool

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.service.resourcepool.ResourcePool
              extended by atg.distributor.SenderResourcePool
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, atg.service.resourcepool.ResourcePoolResourceKeys, java.util.EventListener

public class SenderResourcePool
extends ResourcePool


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.service.resourcepool.ResourcePool
mBlocking, mCheckoutBlockTime, mCreatingResources, mCreationTimeLimit, mFreeResources, mHealthy, mMax, mMaxFree, mMaxPendingCreations, mMaxStartupAttempts, mMin, mPool, mResourceClassName, mStartupSleepTime, mUnusedPoolSlots
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.service.resourcepool.ResourcePoolResourceKeys
RESOURCE_BUNDLE, RSRC_blockTimeout, RSRC_ciCreateFailure, RSRC_ciForeignResource, RSRC_ciWrongResource, RSRC_coNonRunning, RSRC_creationLimit, RSRC_creationTimeout, RSRC_failedInitialPopulation, RSRC_hitPoolMax, RSRC_maxResourcePerThread, RSRC_maxThreads, RSRC_misconfiguration, RSRC_nestedCheckout, RSRC_nonOwningThread, RSRC_notImplemented, RSRC_poolDisabled, RSRC_startupFailure, RSRC_usingClosedConnection
 
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
SenderResourcePool()
          Constructs an instanceof SenderResourcePool
 
Method Summary
 void closeAllConnections()
          Close all the socket connections to every remote server
 java.lang.Object createResource()
          Returns a DistributorSender instance connected to the remote servers
 void destroyResource(java.lang.Object pResource)
          Closes the connections to the remove server
 long getConnectionTimeout()
          Returns the length of time in milliseconds that this connection will wait for a connection to its remote target.
 java.lang.String getContentItemNameProperty()
          Returns property ContentItemNameProperty
 java.io.File getDocumentRoot()
          Returns property DocumentRoot
 java.lang.String getDocumentRootCachePath()
          Returns property DocumentRootCachePath
 java.lang.String getDocumentRootContextPath()
          Get the context path to prepend to generated URI's that refer to files in the document root.
 int getMinReconnectInterval()
          Returns property MinReconnectInterval, the minimum interval between connect retries in msec (default 120000 msec)
 int getReadTimeout()
          Returns property ReadTimeout (default 30000 msec)
 atg.distributor.RemoteServerCache getRemoteServerCache()
          Returns property RemoteServerCache
 java.lang.String[] getServerList()
          Returns property ServerList, the list of host:port combinations that this client should connect to.
 int getWriteTimeout()
          Returns property WriteTimeout (default 30000 msec)
 void initializeAllConnections()
          Attempts to close any open connections, then rebuilds and reconnects to the hosts defined in the serverList property.
 boolean isCacheLocally()
          Returns property CacheLocally.
 boolean isCreateCacheDirectories()
          Returns property CreateCacheDirectories
 boolean isEscapeURI()
          Returns property EscapeURI
 boolean isFlatten()
          Returns property Flatten
 boolean isPre61()
          Returns property pre61
 void openAllConnections()
          Open all the socket connections to every remote server
 void setCacheLocally(boolean pCacheLocally)
          Sets property CacheLocally
 void setConnectionTimeout(long pConnectionTimeout)
          Set the time in milliseconds to wait for a socket when attempting to connect to its remote target.
 void setContentItemNameProperty(java.lang.String pContentItemNameProperty)
          Sets property ContentItemNameProperty
 void setCreateCacheDirectories(boolean pCreateCacheDirectories)
          Sets property CreateCacheDirectories
 void setDocumentRoot(java.io.File pDocumentRoot)
          Sets property DocumentRoot
 void setDocumentRootCachePath(java.lang.String pDocumentRootCachePath)
          Sets property DocumentRootCachePath
 void setDocumentRootContextPath(java.lang.String pDocumentRootContextPath)
          Set the context path to prepend to generated URI's that refer to files in the document root specified by documentRoot.
 void setEscapeURI(boolean pEscapeURI)
          Sets property EscapeURI
 void setFlatten(boolean pFlatten)
          Sets property Flatten
 void setMinReconnectInterval(int pMinReconnectInterval)
          Sets property MinReconnectInterval, the minimum interval between connect retries in msec
 void setPre61(boolean pPre61)
          Sets property pre61
 void setReadTimeout(int pReadTimeout)
          Sets property ReadTimeout
 void setRemoteServerCache(atg.distributor.RemoteServerCache pRemoteServerCache)
          Sets property RemoteServerCache
 void setServerList(java.lang.String[] pServerList)
          Sets property ServerList, the list of host:port combinations that this client should connect to.
 void setWriteTimeout(int pWriteTimeout)
          Sets property WriteTimeout
 
Methods inherited from class atg.service.resourcepool.ResourcePool
addAdminInfo, block, checkIn, checkOut, createAdminServlet, doStartService, doStopService, finalize, getAverageResourceCreationTime, getBlocking, getCheckoutBlockTime, getCreationTimeLimit, getCurrentStack, getDebugConnections, getLastError, getMax, getMaxConcurrentResourcesPerThread, getMaxConcurrentThreads, getMaxFree, getMaxIdleAge, getMaxPendingCreations, getMaxResourceAge, getMaxResourcesPerThread, getMaxSimultaneousResourcesOut, getMaxThreadsWithResourcesOut, getMin, getNumCheckedOutResources, getNumFreeResources, getNumTotalResources, getResourceClassName, getStartupAttempts, getStartupFailureSleepTime, invalidateAllResources, isEnabled, isWarnOnNestedCheckouts, populateSlot, pruneFreeResources, reclaimResource, resetMaxConcurrentResourcesPerThread, resetMaxConcurrentThreads, resetMaxSimultaneousResourcesOut, setBlocking, setCheckoutBlockTime, setCreationTimeLimit, setDebugConnections, setLastError, setMax, setMaxFree, setMaxIdleAge, setMaxPendingCreations, setMaxResourceAge, setMaxResourcesPerThread, setMaxThreadsWithResourcesOut, setMin, setResourceClassName, setStartupAttempts, setStartupFailureSleepTime, setWarnOnNestedCheckouts, unblock, verifyResourceValidity
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

SenderResourcePool

public SenderResourcePool()
Constructs an instanceof SenderResourcePool

Method Detail

setRemoteServerCache

public void setRemoteServerCache(atg.distributor.RemoteServerCache pRemoteServerCache)
Sets property RemoteServerCache


getRemoteServerCache

public atg.distributor.RemoteServerCache getRemoteServerCache()
Returns property RemoteServerCache


setMinReconnectInterval

public void setMinReconnectInterval(int pMinReconnectInterval)
Sets property MinReconnectInterval, the minimum interval between connect retries in msec


getMinReconnectInterval

public int getMinReconnectInterval()
Returns property MinReconnectInterval, the minimum interval between connect retries in msec (default 120000 msec)


setReadTimeout

public void setReadTimeout(int pReadTimeout)
Sets property ReadTimeout


getReadTimeout

public int getReadTimeout()
Returns property ReadTimeout (default 30000 msec)


setWriteTimeout

public void setWriteTimeout(int pWriteTimeout)
Sets property WriteTimeout


getWriteTimeout

public int getWriteTimeout()
Returns property WriteTimeout (default 30000 msec)


setServerList

public void setServerList(java.lang.String[] pServerList)
Sets property ServerList, the list of host:port combinations that this client should connect to.


getServerList

public java.lang.String[] getServerList()
Returns property ServerList, the list of host:port combinations that this client should connect to.


setContentItemNameProperty

public void setContentItemNameProperty(java.lang.String pContentItemNameProperty)
Sets property ContentItemNameProperty


getContentItemNameProperty

public java.lang.String getContentItemNameProperty()
Returns property ContentItemNameProperty


setDocumentRoot

public void setDocumentRoot(java.io.File pDocumentRoot)
Sets property DocumentRoot


getDocumentRoot

public java.io.File getDocumentRoot()
Returns property DocumentRoot


setDocumentRootCachePath

public void setDocumentRootCachePath(java.lang.String pDocumentRootCachePath)
Sets property DocumentRootCachePath


getDocumentRootCachePath

public java.lang.String getDocumentRootCachePath()
Returns property DocumentRootCachePath


setDocumentRootContextPath

public void setDocumentRootContextPath(java.lang.String pDocumentRootContextPath)
Set the context path to prepend to generated URI's that refer to files in the document root specified by documentRoot.

This will typically be null for applications running on the Dynamo Application Server and in the deployment configuration of applications running on DAF but writing files directly into an external HTTP server's document root, where no special handling is necessary to access files in the document root.

It will typically be "/dyn/dyn" in the development and staging configurations of applications running on DAF, where cached documents are stored in the Dynamo document root and served from the third party application server rather than an external HTTP server. In these environments using /dyn/dyn as the context path is required to access files that live in the Dynamo document root.


getDocumentRootContextPath

public java.lang.String getDocumentRootContextPath()
Get the context path to prepend to generated URI's that refer to files in the document root.


setCreateCacheDirectories

public void setCreateCacheDirectories(boolean pCreateCacheDirectories)
Sets property CreateCacheDirectories


isCreateCacheDirectories

public boolean isCreateCacheDirectories()
Returns property CreateCacheDirectories


setCacheLocally

public void setCacheLocally(boolean pCacheLocally)
Sets property CacheLocally


isCacheLocally

public boolean isCacheLocally()
Returns property CacheLocally. If documentRoot is null, then this always returns false


setFlatten

public void setFlatten(boolean pFlatten)
Sets property Flatten


isFlatten

public boolean isFlatten()
Returns property Flatten


setConnectionTimeout

public void setConnectionTimeout(long pConnectionTimeout)
Set the time in milliseconds to wait for a socket when attempting to connect to its remote target. Default is 0 (no timeout).

Parameters:
long - the timeout (milliseconds)

getConnectionTimeout

public long getConnectionTimeout()
Returns the length of time in milliseconds that this connection will wait for a connection to its remote target.


setPre61

public void setPre61(boolean pPre61)
Sets property pre61


isPre61

public boolean isPre61()
Returns property pre61


setEscapeURI

public void setEscapeURI(boolean pEscapeURI)
Sets property EscapeURI


isEscapeURI

public boolean isEscapeURI()
Returns property EscapeURI


createResource

public java.lang.Object createResource()
                                throws ResourcePoolException
Returns a DistributorSender instance connected to the remote servers

Overrides:
createResource in class ResourcePool
Returns:
Object on success
Throws:
ResourcePoolException - if there was a problem creating the resource

destroyResource

public void destroyResource(java.lang.Object pResource)
Closes the connections to the remove server

Overrides:
destroyResource in class ResourcePool
Parameters:
pResource - the Object to destroy

initializeAllConnections

public void initializeAllConnections()
                              throws ResourcePoolException
Attempts to close any open connections, then rebuilds and reconnects to the hosts defined in the serverList property. The doStartService method is invoked to repopulate the minimum number of resources.

Throws:
ResourcePoolException

openAllConnections

public void openAllConnections()
                        throws ResourcePoolException
Open all the socket connections to every remote server

Throws:
ResourcePoolException

closeAllConnections

public void closeAllConnections()
                         throws ResourcePoolException
Close all the socket connections to every remote server

Throws:
ResourcePoolException