Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (C) 2009 eXo Platform SAS.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
 package org.exoplatform.services.jcr.ext.replication;
 
 
 import java.util.List;
 
Created by The eXo Platform SAS.
Proxy of WorkspaceDataManager for "proxy" mode of replication to let replicator not to make persistent changes but replicate cache, indexes etc instead. This is the case if persistent replication is done with some external way (by repliucation enabled RDB or AS etc)

Author(s):
Gennady Azarenkov
Version:
$Id: WorkspaceDataManagerProxy.java 34445 2009-07-24 07:51:18Z dkatayev $
 
 
 public class WorkspaceDataManagerProxy implements ItemDataKeeper
 {

   
The apache logger.
 
    private static Log log = ExoLogger.getLogger("exo.jcr.component.ext.WorkspaceDataManagerProxy");

   
The ItemsPersistenceListeners.
 
    private List<ItemsPersistenceListenerlisteners;

   
WorkspaceDataManagerProxy constructor.

Parameters:
dataManager the CacheableWorkspaceDataManager
searchIndex the SearchManager
lockManager the LockManagerImpl
 
    public WorkspaceDataManagerProxy(CacheableWorkspaceDataManager dataManagerSearchManager searchIndex,
       LockManagerImpl lockManager)
    {
       this. = new ArrayList<ItemsPersistenceListener>();
       .add(dataManager.getCache());
       if (searchIndex != null)
       {
          .add(searchIndex);
       }
 
       if (lockManager != null)
       {
          .add(lockManager);
       }
 
       .info("WorkspaceDataManagerProxy is instantiated");
    }

   
calls onSaveItems on all registered listeners.

Parameters:
changesLog the ChangesLog with data
Throws:
javax.jcr.InvalidItemStateException will be generate the exception InvalidItemStateException
java.lang.UnsupportedOperationException will be generate the exception UnsupportedOperationException
javax.jcr.RepositoryException will be generate the exception RepositoryException
 
   {
      for (ItemsPersistenceListener listener : )
      {
         listener.onSaveItems(changesLog);
      }
      
      if (.isDebugEnabled())
      {
         .debug("ChangesLog sent to " + );
      }
   }
New to GrepCode? Check out our FAQ X