atg.adapter.gsa.invalidator
Class GSAInvalidatorService

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by atg.core.net.RegisteringUnicastRemoteObject
                  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingRMIImpl
                      extended by atg.nucleus.GenericRMIService
                          extended by atg.adapter.gsa.invalidator.GSAInvalidatorService
All Implemented Interfaces:
atg.adapter.gsa.invalidator.GSAInvalidator, MessageSource, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.io.Serializable, java.rmi.Remote, java.util.EventListener

public class GSAInvalidatorService
extends GenericRMIService
implements atg.adapter.gsa.invalidator.GSAInvalidator, MessageSource

This class is a RMI service that waits for requests from outside clients, and issues JMS invalidation events via Patchbay.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected static java.lang.String INVALIDATOR_JMSTYPE
          System property defining the JMS Type & port of the messages sent for cache invalidation
protected static java.lang.String INVALIDATOR_PORT
           
 
Fields inherited from class atg.nucleus.GenericRMIService
SERVICE_INFO_KEY
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
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
GSAInvalidatorService()
          GenericRMIService constructors must be able to throw RemoteExceptions.
 
Method Summary
 boolean getActive()
          Retrieve the active flag, which indicates if this component can send messages.
 boolean getEnabled()
          Retrieve the enabled flag, which indicates if this component can send messages, as long as the active flag is also true.
 int getMaxItemsPerEvent()
           
 MessageSourceContext getMessageSourceContext()
          Gets the messageSourceContext for this MessageSource.
 int getNumCompressedEventsSent()
           
 int getNumEventsSent()
           
 java.lang.String getServerId()
          Returns the unique id to be used for tagging events in this server
 atg.service.ServerName getServerName()
           
 void invalidate(atg.adapter.gsa.invalidator.MultiTypeInvalidationMessage pInfoMessage)
          Invalidator interface remote method which receives a MultiTypeInvalidationMessage from local or RMI clients, and emits a JMS Message containing a this MultiTypeInvalidationMessage object.
 void invalidate(java.lang.String pRepositoryName, java.lang.String pItemDescriptorName, java.lang.String pItemId)
          Invalidator interface remote method which receives invalidate events from RMI clients, and emits a JMS Message containing a GSAInvalidationMessage object.
 void setActive(boolean pActive)
          Set the active flag, indicating this component can send messages.
 void setEnabled(boolean pEnabled)
          Set the enabled flag, which has to be set along with the active flag for this component to send messages.
 void setMaxItemsPerEvent(int pMaxItemsPerEvent)
          Sets the property MaxItemsPerEvent.
 void setMessageSourceContext(MessageSourceContext pContext)
          MessageSource interface method to set the MessageSourceContext for this MessageSource.
 void setNumCompressedEventsSent(int pNumCompressedEventsSent)
          Sets the property NumCompressedEventsSent.
 void setNumEventsSent(int pNumEventsSent)
          Sets the property NumEventsSent.
 void setServerName(atg.service.ServerName pServerName)
          Sets the property ServerName.
 void startMessageSource()
          MessageSource interface method to signal this MessageSource that it is now legal to emit messages.
 void stopMessageSource()
          MessageSource interface method to signal this MessageSource that it is no longer legal to emit messages.
 
Methods inherited from class atg.nucleus.GenericRMIService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRef, 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, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingRMIImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class atg.core.net.RegisteringUnicastRemoteObject
unexportAll
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


INVALIDATOR_JMSTYPE

protected static final java.lang.String INVALIDATOR_JMSTYPE
System property defining the JMS Type & port of the messages sent for cache invalidation

See Also:
Constant Field Values

INVALIDATOR_PORT

protected static final java.lang.String INVALIDATOR_PORT
See Also:
Constant Field Values
Constructor Detail

GSAInvalidatorService

public GSAInvalidatorService()
                      throws java.rmi.RemoteException
GenericRMIService constructors must be able to throw RemoteExceptions.

Throws:
java.rmi.RemoteException
Method Detail

setMaxItemsPerEvent

public void setMaxItemsPerEvent(int pMaxItemsPerEvent)
Sets the property MaxItemsPerEvent. This defines the maximum number of items that should be put into a cache-mode="distributedJMS" style event. The size of a MultiTypeInvalidationMessage storing this number of events should comfortably fit into the maximum sizes JMSEvent your system is configured with. If an event surpasses this limit, it will send an invalidation event which flushes the entire cache for each type of item that needs to be invalidated beyond the max number. You can set this value to 0 if you want to always fire events which invalidate the cache for the entire type of item, instead of invalidating only the ids of the items you modify. For example, each time a product is modified, you'd invalidate the caches for all products.

Parameters:
pMaxItemsPerEvent - new value to set

getMaxItemsPerEvent

public int getMaxItemsPerEvent()
Returns:
The value of the property MaxItemsPerEvent.

setNumEventsSent

public void setNumEventsSent(int pNumEventsSent)
Sets the property NumEventsSent. This is the number of events sent by the invalidator since the server was started.

Parameters:
pNumEventsSent - new value to set

getNumEventsSent

public int getNumEventsSent()
Returns:
The value of the property NumEventsSent.

setNumCompressedEventsSent

public void setNumCompressedEventsSent(int pNumCompressedEventsSent)
Sets the property NumCompressedEventsSent.

Parameters:
pNumCompressedEventsSent - new value to set

getNumCompressedEventsSent

public int getNumCompressedEventsSent()
Returns:
The value of the property NumCompressedEventsSent.

setMessageSourceContext

public void setMessageSourceContext(MessageSourceContext pContext)
MessageSource interface method to set the MessageSourceContext for this MessageSource.

Specified by:
setMessageSourceContext in interface MessageSource

getMessageSourceContext

public MessageSourceContext getMessageSourceContext()
Gets the messageSourceContext for this MessageSource.


setActive

public void setActive(boolean pActive)
Set the active flag, indicating this component can send messages.

Parameters:
pActive - Boolean that indicates whether GSA Cache invalidation service is ready or not

getActive

public boolean getActive()
Retrieve the active flag, which indicates if this component can send messages.

Returns:
Active flag

setEnabled

public void setEnabled(boolean pEnabled)
Set the enabled flag, which has to be set along with the active flag for this component to send messages.

Parameters:
pEnabled - Boolean that enables (TRUE) or disables (FALSE) GSA Cache invalidation via JMS

getEnabled

public boolean getEnabled()
Retrieve the enabled flag, which indicates if this component can send messages, as long as the active flag is also true.

Returns:
Enabled flag

setServerName

public void setServerName(atg.service.ServerName pServerName)
Sets the property ServerName.

Parameters:
pServerName - new value to set

getServerName

public atg.service.ServerName getServerName()
Returns:
The value of the property ServerName.

getServerId

public java.lang.String getServerId()
Returns the unique id to be used for tagging events in this server


startMessageSource

public void startMessageSource()
MessageSource interface method to signal this MessageSource that it is now legal to emit messages. This implementation sets the "active" flag to true.

Specified by:
startMessageSource in interface MessageSource

stopMessageSource

public void stopMessageSource()
MessageSource interface method to signal this MessageSource that it is no longer legal to emit messages. This implementation sets the "active" flag to false.

Specified by:
stopMessageSource in interface MessageSource

invalidate

public void invalidate(java.lang.String pRepositoryName,
                       java.lang.String pItemDescriptorName,
                       java.lang.String pItemId)
                throws java.rmi.RemoteException
Invalidator interface remote method which receives invalidate events from RMI clients, and emits a JMS Message containing a GSAInvalidationMessage object.

Specified by:
invalidate in interface atg.adapter.gsa.invalidator.GSAInvalidator
Parameters:
pRepositoryName - Name of repository to invalidate
pItemDescriptorName - Name of item descriptor type to invalidate
pItemId - Item ID of specific item to invalidate via distributed dynamo repository facility
Throws:
java.rmi.RemoteException - Nothing thrown in this version

invalidate

public void invalidate(atg.adapter.gsa.invalidator.MultiTypeInvalidationMessage pInfoMessage)
                throws java.rmi.RemoteException
Invalidator interface remote method which receives a MultiTypeInvalidationMessage from local or RMI clients, and emits a JMS Message containing a this MultiTypeInvalidationMessage object.

Parameters:
pMessage - The MultiTypeInvalidationMessage to send
Throws:
java.rmi.RemoteException - Nothing thrown in this version