|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.svc.agent.environment.EnvironmentMonitor
public abstract class EnvironmentMonitor
This class provides the main interface for applications to participate in monitoring and changing the agent's working environment objects.
Using an EnvironmentMonitor
, applications can monitor changes made by other
application and also make changes of their own that can be monitored by other applications.
Changes to the environment are applied in the following steps:
Each application monitor is called back whenever a change is initiated. During this
step, each monitor can add any initial EnvironmentChangeDetail
objects to identify
changes that will take place as a result.
A single EnvironmentChangeDetail
object is used to identify a change to
a single environment object.
EnvironmentChangeDetail
EnvironmentChangeFormHandler
,
these warnings must be acknowledged by the agent before the changes are applied.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected EnvironmentTools |
mEnvironmentTools
|
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 | |
---|---|
EnvironmentMonitor()
|
Method Summary | |
---|---|
abstract void |
applyChanges(EnvironmentChangeState pEnvironmentChangeState)
This method is called back to apply the changes detailed in the state. |
void |
createWarningsForEnvironmentChange(EnvironmentChangeState pEnvironmentChangeState)
This method is called back to create warnings related to the changes detailed in the state. |
void |
generateChangeDetails(EnvironmentChangeState pEnvironmentChangeState,
EnvironmentChangeDetail pEnvironmentChangeDetail)
Adds EnvironmentChangeDetail objects triggered by callbacks about changes to
the environment. |
protected abstract void |
generateChangeDetailsForChangeKey(java.lang.String pChangeKey,
EnvironmentChangeState pEnvironmentChangeState)
This method is called to generate the initial change details for the given change key. |
protected abstract void |
generateDependentChangeDetails(EnvironmentChangeDetail pEnvironmentChangeDetail,
EnvironmentChangeState pEnvironmentChangeState)
This method is called to generate change details that result from the given EnvironmentChangeDetail. |
atg.agent.events.AgentMessagingTools |
getAgentMessagingTools()
Returns component for sending agent messages |
abstract java.lang.Object |
getEnvironmentObject(java.lang.String pEnvironmentObjectName)
This method should be implemented to return the environment objects exposed by the environment monitor. |
EnvironmentTools |
getEnvironmentTools()
|
void |
initializeDefaultsForProfile(atg.repository.MutableRepositoryItem pProfile)
This method is called back to initialize a new profile for the environment. |
void |
postApplyChanges(EnvironmentChangeState pEnvironmentChangeState)
This method is called back when applying changes to the environment. |
void |
preApplyChanges(EnvironmentChangeState pEnvironmentChangeState)
This method is called back when applying changes to the environment. |
void |
revertChanges(EnvironmentChangeState pEnvironmentChangeState)
This method is called back when the transaction is rolled back during the apply process. |
void |
setAgentMessagingTools(atg.agent.events.AgentMessagingTools pAgentMessagingTools)
Sets the component for sending agent messages |
void |
setEnvironmentTools(EnvironmentTools pEnvironmentTools)
|
Methods inherited from class atg.nucleus.GenericService |
---|
addLogListener, createAdminServlet, doStartService, doStopService, 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, 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_VERSION
protected EnvironmentTools mEnvironmentTools
Constructor Detail |
---|
public EnvironmentMonitor()
Method Detail |
---|
public void setAgentMessagingTools(atg.agent.events.AgentMessagingTools pAgentMessagingTools)
pAgentMessagingTools
- public atg.agent.events.AgentMessagingTools getAgentMessagingTools()
public EnvironmentTools getEnvironmentTools()
public void setEnvironmentTools(EnvironmentTools pEnvironmentTools)
public void generateChangeDetails(EnvironmentChangeState pEnvironmentChangeState, EnvironmentChangeDetail pEnvironmentChangeDetail) throws EnvironmentException
EnvironmentChangeDetail
objects triggered by callbacks about changes to
the environment.
Each EnvironmentChangeDetail
represents a change to a single environment object.
There can be only one detail per environment object in the state.
This callback routine is generates the EnvironmentChangeDetail
objects relative to a specific change in the environment, like changing the current ticket.
There's two ways this method is called. It's either with or without a contextual
EnvironmentChangeDetail
. The EnvironmentChangeState
is constant.
At the beginning of the change process, this method is called once without the contextual EnvironmentChangeDetail. In this case, applications respond to the change key in the EnvironemtChangeState and create the initial change detail objects. For example, when changing the current customer, the initial change detail is created by the framework that represents a change of customer.
After the initial set of change details are created, the monitors are called back again for each new change detail that was added in the initial pass to generate any dependent change details. This process goes on until no more new change details are added by the application monitors.
This method calls two other methods depending on whether it's called with a change detail.
EnvironmentException
generateChangeDetailsForChangeKey(String, EnvironmentChangeState)
,
generateDependentChangeDetails(EnvironmentChangeDetail, EnvironmentChangeState)
protected abstract void generateChangeDetailsForChangeKey(java.lang.String pChangeKey, EnvironmentChangeState pEnvironmentChangeState) throws atg.svc.agent.environment.EnvironmentChangeDetailConflict, EnvironmentException
Applications should extend this method to react to framework level or custom environment change keys.
pChangeKey
- pEnvironmentChangeState
-
atg.svc.agent.environment.EnvironmentChangeDetailConflict
EnvironmentException
protected abstract void generateDependentChangeDetails(EnvironmentChangeDetail pEnvironmentChangeDetail, EnvironmentChangeState pEnvironmentChangeState) throws atg.svc.agent.environment.EnvironmentChangeDetailConflict, EnvironmentException
pEnvironmentChangeDetail
- pEnvironmentChangeState
-
atg.svc.agent.environment.EnvironmentChangeDetailConflict
EnvironmentException
public void preApplyChanges(EnvironmentChangeState pEnvironmentChangeState) throws EnvironmentException
applyChanges
method.
EnvironmentExceptions thrown by the monitors in the preApplyChanges
method will result in
the change being aborted.
This is a noop impl.
pEnvironmentChangeState
-
EnvironmentException
EnvironmentTools.applyChanges(EnvironmentChangeState)
public abstract void applyChanges(EnvironmentChangeState pEnvironmentChangeState) throws EnvironmentException
EnvironmentExceptions thrown by the monitors in the applyChanges
method will result in
the transaction being marked for rollback and each monitor that was called to apply to be called again
through the revertChanges
interface to revert their changes.
pEnvironmentChangeState
-
EnvironmentException
EnvironmentTools.applyChanges(EnvironmentChangeState)
,
revertChanges(EnvironmentChangeState)
public void revertChanges(EnvironmentChangeState pEnvironmentChangeState)
pEnvironmentChangeState
- EnvironmentTools.applyChanges(EnvironmentChangeState)
public void postApplyChanges(EnvironmentChangeState pEnvironmentChangeState) throws EnvironmentException
applyChanges
method.
EnvironmentExceptions thrown by the monitors in the postApplyChanges
method will be
logged but will not cause a revert of the change and the remaining monitors will still have their
postApplyChanges method called.
Note: Monitors should not execute code that could
cause a transaction roll back in postApplyChanges
as it could lead to an inconsistent state
in the application.
This is a noop impl.
pEnvironmentChangeState
-
EnvironmentException
EnvironmentTools.applyChanges(EnvironmentChangeState)
public void createWarningsForEnvironmentChange(EnvironmentChangeState pEnvironmentChangeState) throws EnvironmentException
Generated warnings should be added to the given EnvironmentChangeState
pEnvironmentChangeState
-
EnvironmentException
EnvironmentChangeState.addWarnings(List)
,
This is a noop implementation.
public void initializeDefaultsForProfile(atg.repository.MutableRepositoryItem pProfile) throws EnvironmentException
pProfile
-
EnvironmentException
public abstract java.lang.Object getEnvironmentObject(java.lang.String pEnvironmentObjectName) throws EnvironmentException
pEnvironmentObjectName
-
EnvironmentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |