Examples of CacheableSessionLockManager


Examples of org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableSessionLockManager

                        + "<2 \n" + currChangesLog.dump());
                     break;
                  }
                  nodeIdentifier = currChangesLog.getAllStates().get(0).getData().getParentIdentifier();

                  CacheableSessionLockManager session = sessionLockManagers.get(sessionId);
                  if (session != null && session.containsPendingLock(nodeIdentifier))
                  {
                     containers.add(new LockOperationContainer(nodeIdentifier, currChangesLog.getSessionId(),
                        ExtendedEvent.LOCK));
                  }
                  else
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableSessionLockManager

    * @param nodeIdentifier
    * @throws LockException
    */
   private synchronized void internalLock(String sessionId, String nodeIdentifier) throws RepositoryException
   {
      CacheableSessionLockManager sessionLockManager = sessionLockManagers.get(sessionId);
      if (sessionLockManager != null && sessionLockManager.containsPendingLock(nodeIdentifier))
      {
         LockData lockData = sessionLockManager.getPendingLock(nodeIdentifier);

         // add to DB for first
         LockJDBCConnection connection = null;
         try
         {
            // write to database
            connection = this.lockJDBCContainer.openConnection();
            connection.addLockData(lockData);
            connection.commit();

            // if any SQL exception, that nothing should be placed to cache
            Fqn<String> lockPath = makeLockFqn(lockData.getNodeIdentifier());

            cache.put(lockPath, LOCK_DATA, lockData);

            sessionLockManager.notifyLockPersisted(nodeIdentifier);
         }
         finally
         {
            if (connection != null)
            {
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableSessionLockManager

            connection.removeLockData(nodeIdentifier);
            connection.commit();

            //second remove from cache
            cache.removeNode(makeLockFqn(nodeIdentifier));
            CacheableSessionLockManager sessMgr = sessionLockManagers.get(sessionId);
            if (sessMgr != null)
            {
               sessMgr.notifyLockRemoved(nodeIdentifier);
            }
         }
         catch (RepositoryException e)
         {
            throw new LockException(e);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableSessionLockManager

   /**
    * Return new instance of session lock manager.
    */
   public SessionLockManager getSessionLockManager(String sessionId, SessionDataManager transientManager)
   {
      CacheableSessionLockManager sessionManager = new CacheableSessionLockManager(sessionId, this, transientManager);
      sessionLockManagers.put(sessionId, sessionManager);
      return sessionManager;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableSessionLockManager

                        + "<2 \n" + currChangesLog.dump());
                     break;
                  }
                  nodeIdentifier = currChangesLog.getAllStates().get(0).getData().getParentIdentifier();

                  CacheableSessionLockManager session = sessionLockManagers.get(sessionId);
                  if (session != null && session.containsPendingLock(nodeIdentifier))
                  {
                     containers.add(new LockOperationContainer(nodeIdentifier, currChangesLog.getSessionId(),
                        ExtendedEvent.LOCK));
                  }
                  else
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableSessionLockManager

    * @param nodeIdentifier
    * @throws LockException
    */
   private synchronized void internalLock(String sessionId, String nodeIdentifier) throws RepositoryException
   {
      CacheableSessionLockManager sessionLockManager = sessionLockManagers.get(sessionId);
      if (sessionLockManager != null && sessionLockManager.containsPendingLock(nodeIdentifier))
      {
         LockData lockData = sessionLockManager.getPendingLock(nodeIdentifier);

         // add to DB for first
         LockJDBCConnection connection = null;
         try
         {
            // write to database
            connection = this.lockJDBCContainer.openConnection();
            connection.addLockData(lockData);
            connection.commit();

            // if any SQL exception, that nothing should be placed to cache
            Fqn<String> lockPath = makeLockFqn(lockData.getNodeIdentifier());

            cache.put(lockPath, LOCK_DATA, lockData);

            sessionLockManager.notifyLockPersisted(nodeIdentifier);
         }
         finally
         {
            if (connection != null)
            {
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableSessionLockManager

            connection.removeLockData(nodeIdentifier);
            connection.commit();

            //second remove from cache
            cache.removeNode(makeLockFqn(nodeIdentifier));
            CacheableSessionLockManager sessMgr = sessionLockManagers.get(sessionId);
            if (sessMgr != null)
            {
               sessMgr.notifyLockRemoved(nodeIdentifier);
            }
         }
         catch (RepositoryException e)
         {
            throw new LockException(e);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableSessionLockManager

   /**
    * Return new instance of session lock manager.
    */
   public SessionLockManager getSessionLockManager(String sessionId, SessionDataManager transientManager)
   {
      CacheableSessionLockManager sessionManager = new CacheableSessionLockManager(sessionId, this, transientManager);
      sessionLockManagers.put(sessionId, sessionManager);
      return sessionManager;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableSessionLockManager

                        + "<2 \n" + currChangesLog.dump());
                     break;
                  }
                  nodeIdentifier = currChangesLog.getAllStates().get(0).getData().getParentIdentifier();

                  CacheableSessionLockManager session = sessionLockManagers.get(sessionId);
                  if (session != null && session.containsPendingLock(nodeIdentifier))
                  {
                     containers.add(new LockOperationContainer(nodeIdentifier, currChangesLog.getSessionId(),
                        ExtendedEvent.LOCK));
                  }
                  else
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableSessionLockManager

    * @param nodeIdentifier
    * @throws LockException
    */
   private synchronized void internalLock(String sessionId, String nodeIdentifier) throws RepositoryException
   {
      CacheableSessionLockManager sessionLockManager = sessionLockManagers.get(sessionId);
      if (sessionLockManager != null && sessionLockManager.containsPendingLock(nodeIdentifier))
      {
         LockData lockData = sessionLockManager.getPendingLock(nodeIdentifier);

         // add to DB for first
         LockJDBCConnection connection = null;
         try
         {
            // write to database
            connection = this.lockJDBCContainer.openConnection();
            connection.addLockData(lockData);
            connection.commit();

            // if any SQL exception, that nothing should be placed to cache
            Fqn<String> lockPath = makeLockFqn(lockData.getNodeIdentifier());

            cache.put(lockPath, LOCK_DATA, lockData);

            sessionLockManager.notifyLockPersisted(nodeIdentifier);
         }
         finally
         {
            if (connection != null)
            {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.