public class QueueingPropertiesChangeListener extends GenericService implements PropertiesChangedListener
Created: April 07 2014
Modifier and Type | Class and Description |
---|---|
class |
QueueingPropertiesChangeListener.IndexedRepositoryAndType
A class that represents the target repository and type.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
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 |
---|
QueueingPropertiesChangeListener() |
Modifier and Type | Method and Description |
---|---|
protected void |
addOrRemoveAsPropertiesChangedListener(boolean pAdd)
Add or remove ourselves as a property change listener to our
item descriptor, and any subtypes.
|
void |
doStartService()
This is called after a Service has been created, placed into the
naming hierarchy, and initialized with its configured property
values.
|
void |
doStopService()
This is called when a Service is required to shut down.
|
atg.repository.search.indexing.IncrementalLoaderImpl |
getIncrementalLoader()
Returns property incrementalLoader.
|
RepositoryItemDescriptor |
getItemDescriptor()
Returns property itemDescriptor.
|
java.lang.String |
getItemDescriptorName()
Returns property itemDescriptorName.
|
java.util.Set<RepositoryPropertyDescriptor> |
getMonitoredPropertyDescriptors()
Returns property monitoredPropertyDescriptors.
|
java.lang.String[] |
getMonitoredPropertyNames()
Returns property monitoredPropertyNames.
|
java.util.Map<java.lang.String,java.lang.String> |
getReferencingPropertyToIndexedRepositoryAndType()
Returns property referencingPropertyToIndexedRepositoryAndType.
|
atg.nucleus.DelayedResolver<Repository> |
getRepository()
Returns property repository.
|
protected java.lang.String[] |
getRepositoryIdsFromValue(java.lang.Object pValue)
Return the repository IDs from the specified value.
|
protected void |
handlePropertiesChanged(PropertiesChangedEvent pEvent,
RepositoryItem pItem)
Actually handle the properties change event.
|
boolean |
isDelayStartup()
Returns property delayStartup.
|
void |
propertiesChanged(PropertiesChangedEvent pEvent) |
protected boolean |
queueItemChanged(java.lang.String pRepositoryPath,
java.lang.String pItemDescriptorName,
java.lang.String pSubTypeItemDescriptorName,
java.lang.String pRepositoryId,
int pEventType)
Queue that the specified repository item has changed.
|
void |
setDelayStartup(boolean pDelayStartup)
Sets property delayStartup.
|
void |
setIncrementalLoader(atg.repository.search.indexing.IncrementalLoaderImpl pIncrementalLoader)
Sets property incrementalLoader.
|
void |
setItemDescriptor(RepositoryItemDescriptor pItemDescriptor)
Sets property itemDescriptor.
|
void |
setItemDescriptorName(java.lang.String pItemDescriptorName)
Sets property itemDescriptorName.
|
void |
setMonitoredPropertyNames(java.lang.String[] pMonitoredPropertyNames)
Sets property monitoredPropertyNames.
|
void |
setReferencingPropertyToIndexedRepositoryAndType(java.util.Map<java.lang.String,java.lang.String> pReferencingPropertyToIndexedRepositoryAndType)
Sets property referencingPropertyToIndexedRepositoryAndType.
|
void |
setRepository(atg.nucleus.DelayedResolver<Repository> pRepository)
Sets property repository.
|
void |
setup()
Do any actual startup work.
|
protected boolean |
shouldQueueChange(PropertiesChangedEvent pEvent)
Return whether should queue a change.
|
addLogListener, createAdminServlet, 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, toString
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public void setIncrementalLoader(atg.repository.search.indexing.IncrementalLoaderImpl pIncrementalLoader)
@NotNull public atg.repository.search.indexing.IncrementalLoaderImpl getIncrementalLoader()
public void setReferencingPropertyToIndexedRepositoryAndType(java.util.Map<java.lang.String,java.lang.String> pReferencingPropertyToIndexedRepositoryAndType)
public java.util.Map<java.lang.String,java.lang.String> getReferencingPropertyToIndexedRepositoryAndType()
public void setRepository(atg.nucleus.DelayedResolver<Repository> pRepository)
@NotNull public atg.nucleus.DelayedResolver<Repository> getRepository()
public void setItemDescriptorName(java.lang.String pItemDescriptorName)
public java.lang.String getItemDescriptorName()
public void setItemDescriptor(RepositoryItemDescriptor pItemDescriptor)
public RepositoryItemDescriptor getItemDescriptor()
public void setDelayStartup(boolean pDelayStartup)
public boolean isDelayStartup()
public void setMonitoredPropertyNames(java.lang.String[] pMonitoredPropertyNames)
public java.lang.String[] getMonitoredPropertyNames()
public java.util.Set<RepositoryPropertyDescriptor> getMonitoredPropertyDescriptors()
protected boolean queueItemChanged(java.lang.String pRepositoryPath, java.lang.String pItemDescriptorName, java.lang.String pSubTypeItemDescriptorName, java.lang.String pRepositoryId, int pEventType)
pRepositoryPath
- the path of the repository.pItemDescriptorName
- the item descriptor name of the item
actually mentioned in the IOC.pSubTypeItemDescriptorName
- the ACTUAL subtype of the
actual item.pRepositoryId
- the ID of the repository item to queue
a change for.pEventType
- the even type, such as
PropertiesChangedEvent.UPDATE.public void propertiesChanged(PropertiesChangedEvent pEvent)
propertiesChanged
in interface PropertiesChangedListener
protected boolean shouldQueueChange(PropertiesChangedEvent pEvent)
pEvent
- the event to possibly queue.protected void handlePropertiesChanged(PropertiesChangedEvent pEvent, RepositoryItem pItem) throws RepositoryException
pEvent
- the originating properties changed event.pItem
- the item in question.RepositoryException
protected java.lang.String[] getRepositoryIdsFromValue(java.lang.Object pValue)
pValue
- the value. May be a string repository ID, or
a RepositoryItem, but could be extended to handle collections
of values.public void setup()
protected void addOrRemoveAsPropertiesChangedListener(boolean pAdd) throws RepositoryException
pAdd
- if true, add. If false, remove.RepositoryException
public void doStartService() throws ServiceException
GenericService
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic void doStopService() throws ServiceException
GenericService
doStopService
in class GenericService
ServiceException
- if the Service had a problem shutting down