When you are creating a multiple site environment, changing one environment object may affect another environment object. For example, if you change an order, it may change the site, price list, sale price list, user, ticket or other environment-managed objects.
In a multisite setting, environment management recognizes site support and manages site-related effects. Because basic site environment management support is added to Service Center, functions like pricing model holder initialization, site dependent changes or order dependent changes are supported using the /atg/svc/agent/environment/EnvironmentTools API.
The atg.svc.agent.environment.EnvironmentTools API is configured as follows:
/atg/svc/agent/environment/EnvironmentTools.java
  public void addChangeSiteDetail(String pNewSiteId,
EnvironmentChangeState
    pEnvironmentChangeState) throws EnvironmentChangeDetailConflict,
    EnvironmentException {}
  public Site getCurrentSite() throws EnvironmentException {}
  public void setCurrentSite(Site pSite) throws EnvironmentException {}The following methods are used to get or set site information:
- addChangeSiteDetail– This method adds site change details
- getCurrentSite– This method obtains the current site from the- CurrentSiteHolder
- setCurrentSite– This method sets the current site in the- CurrentSiteHolder
The ServiceEnvironmentMonitor API also sets site information:
/atg/svc/agent/environment/ServiceEnvironmentMonitor.java
  protected void
    generateInitialChangesForChangeSite(EnvironmentChangeState
    pEnvironmentChangeState)  throws EnvironmentException {}
  public void revertSiteChangeDetail(EnvironmentChangeDetail
    pEnvironmentChangeDetail,EnvironmentChangeState
    pEnvironmentChangeState) {}
  public void applySiteChangeDetail(EnvironmentChangeDetail
    pEnvironmentChangeDetail, EnvironmentChangeState
    pEnvironmentChangeState)throws EnvironmentException {}The ServiceEnvironmentMonitor uses the following methods:
- generateInitialChangesForChangeSite– generates initial changes for the change site
- applySiteChangeDetail– This method applies the site change information in the- CurrentSiteHolder
- revertSiteChangeDetail– This method reverts site details to the old site details that are set in the- CurrentSiteHolder

