Package org.exoplatform.services.jcr.config

Examples of org.exoplatform.services.jcr.config.LockManagerEntry


            .setType("org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache");
         cacheEntry.setEnabled(cacheEnabled);
      }

      // Lock
      LockManagerEntry lockManagerEntry = new LockManagerEntry();
      lockManagerEntry.putParameterValue("time-out", "15m");
      if (ispnCacheEnabled())
      {
         lockManagerEntry
            .setType("org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl");
         lockManagerEntry.putParameterValue("infinispan-configuration", "conf/standalone/test-infinispan-lock.xml");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.table.name", "lk");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.table.create", "true");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.table.drop", "false");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.id.column", "id");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.data.column", "data");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.timestamp.column", "timestamp");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.datasource", dsName);
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.connectionFactory",
            "org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory");
      }
      else
      {
         lockManagerEntry.setType("org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl");
         lockManagerEntry.putParameterValue("jbosscache-configuration", "conf/standalone/test-jbosscache-lock.xml");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.name", "jcrlocks");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.create", "true");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.drop", "false");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.primarykey",
            "jcrlocks_" + IdGenerator.generate());
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.fqn.column", "fqn");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.node.column", "node");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.parent.column", "parent");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.datasource", dsName);
         lockManagerEntry.putParameterValue("jbosscache-shareable", String.valueOf(cacheShared));
      }

      WorkspaceEntry workspaceEntry = new WorkspaceEntry();
      workspaceEntry.setContainer(containerEntry);
      workspaceEntry.setCache(cacheEntry);
View Full Code Here


      workspaceEntry.setCache(cacheEntry);

      workspaceEntry.setQueryHandler(qEntry);

      LockManagerEntry lockManagerEntry = new LockManagerEntry();
      lockManagerEntry.setTimeout(900000);
      LockPersisterEntry lockPersisterEntry = new LockPersisterEntry();
      lockPersisterEntry.setType("org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister");
      ArrayList<SimpleParameterEntry> lockPersisterParameters = new ArrayList<SimpleParameterEntry>();
      lockPersisterParameters.add(new SimpleParameterEntry("path", "target/temp/lock/" + wsName));
      lockPersisterEntry.setParameters(lockPersisterParameters);
      lockManagerEntry.setPersister(lockPersisterEntry);

      workspaceEntry.setLockManager(lockManagerEntry);

      // workspaceEntry
      return workspaceEntry;
View Full Code Here

      CacheEntry cacheEntry = new CacheEntry(cacheParams);
      cacheEntry.setEnabled(wsEntry.getCache().getEnabled());
      cacheEntry.setType(wsEntry.getCache().getType());

      // Lock
      LockManagerEntry lockManagerEntry = new LockManagerEntry();
      lockManagerEntry.setTimeout(wsEntry.getLockManager().getTimeout());
      if (wsEntry.getLockManager().getPersister() != null)
      {
         LockPersisterEntry lockPersisterEntry = new LockPersisterEntry();
         lockPersisterEntry.setType(wsEntry.getLockManager().getPersister().getType());
         ArrayList<SimpleParameterEntry> lockPersisterParameters = new ArrayList<SimpleParameterEntry>();
         lockPersisterParameters.addAll(wsEntry.getLockManager().getPersister().getParameters());
         lockPersisterEntry.setParameters(lockPersisterParameters);
         lockManagerEntry.setPersister(lockPersisterEntry);
      }

      WorkspaceEntry workspaceEntry = new WorkspaceEntry();
      workspaceEntry.setContainer(containerEntry);
      workspaceEntry.setCache(cacheEntry);
View Full Code Here

   private void clearLockTable(ManageableRepository repository) throws RepositoryConfigurationException, SQLException,
      NamingException
   {
      WorkspaceEntry workspaceEntry = repository.getConfiguration().getWorkspaceEntries().get(0);
      LockManagerEntry lockManagerEntry = workspaceEntry.getLockManager();

      String sourceName = null;
      String queryStatement = null;

      if (helper.ispnCacheEnabled())
      {
         sourceName = lockManagerEntry.getParameterValue("infinispan-cl-cache.jdbc.datasource");

         queryStatement =
            "DELETE FROM " + lockManagerEntry.getParameterValue("infinispan-cl-cache.jdbc.table.name") + "_" + "L"
               + workspaceEntry.getUniqueName().replace("_", "").replace("-", "_");
      }
      else
      {
         sourceName = lockManagerEntry.getParameterValue(CacheableLockManagerImpl.JBOSSCACHE_JDBC_CL_DATASOURCE);

         if (lockManagerEntry.getParameterBoolean("jbosscache-shareable"))
         {
            queryStatement =
               "DELETE FROM " + lockManagerEntry.getParameterValue(CacheableLockManagerImpl.JBOSSCACHE_JDBC_TABLE_NAME)
                  + " WHERE PARENT='/" + workspaceEntry.getUniqueName() + "/" + CacheableLockManagerImpl.LOCKS + "'";
         }
         else
         {
            queryStatement =
               "DELETE FROM " + lockManagerEntry.getParameterValue(CacheableLockManagerImpl.JBOSSCACHE_JDBC_TABLE_NAME)
                  + " WHERE PARENT='/" + CacheableLockManagerImpl.LOCKS + "'";
         }
      }

      Connection conn = ((DataSource)new InitialContext().lookup(sourceName)).getConnection();
View Full Code Here

            .setType("org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache");
         cacheEntry.setEnabled(cacheEnabled);
      }

      // Lock
      LockManagerEntry lockManagerEntry = new LockManagerEntry();
      lockManagerEntry.putParameterValue("time-out", "15m");
      if (ispnCacheEnabled())
      {
         lockManagerEntry
            .setType("org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl");
         lockManagerEntry.putParameterValue("infinispan-configuration", "conf/standalone/test-infinispan-lock.xml");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.table.name", "lk");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.table.create", "true");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.table.drop", "false");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.id.column", "id");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.data.column", "data");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.timestamp.column", "timestamp");
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.datasource", dsName);
         lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.connectionFactory",
            "org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory");
      }
      else
      {
         lockManagerEntry.setType("org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl");
         lockManagerEntry.putParameterValue("jbosscache-configuration", "conf/standalone/test-jbosscache-lock.xml");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.name", "jcrlocks");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.create", "true");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.drop", "false");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.primarykey",
            "jcrlocks_" + IdGenerator.generate());
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.fqn.column", "fqn");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.node.column", "node");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.parent.column", "parent");
         lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.datasource", dsName);
         lockManagerEntry.putParameterValue("jbosscache-shareable", String.valueOf(cacheShared));
      }

      WorkspaceEntry workspaceEntry = new WorkspaceEntry();
      workspaceEntry.setContainer(containerEntry);
      workspaceEntry.setCache(cacheEntry);
View Full Code Here

      workspaceEntry.setCache(cacheEntry);

      workspaceEntry.setQueryHandler(qEntry);

      LockManagerEntry lockManagerEntry = new LockManagerEntry();
      lockManagerEntry.setTimeout(900000);
      LockPersisterEntry lockPersisterEntry = new LockPersisterEntry();
      lockPersisterEntry.setType("org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister");
      ArrayList<SimpleParameterEntry> lockPersisterParameters = new ArrayList<SimpleParameterEntry>();
      lockPersisterParameters.add(new SimpleParameterEntry("path", "target/temp/lock/" + wsName));
      lockPersisterEntry.setParameters(lockPersisterParameters);
      lockManagerEntry.setPersister(lockPersisterEntry);

      workspaceEntry.setLockManager(lockManagerEntry);

      // workspaceEntry
      return workspaceEntry;
View Full Code Here

      CacheEntry cacheEntry = new CacheEntry(cacheParams);
      cacheEntry.setEnabled(wsEntry.getCache().getEnabled());
      cacheEntry.setType(wsEntry.getCache().getType());

      // Lock
      LockManagerEntry lockManagerEntry = new LockManagerEntry();
      lockManagerEntry.setTimeout(wsEntry.getLockManager().getTimeout());
      if (wsEntry.getLockManager().getPersister() != null)
      {
         LockPersisterEntry lockPersisterEntry = new LockPersisterEntry();
         lockPersisterEntry.setType(wsEntry.getLockManager().getPersister().getType());
         ArrayList<SimpleParameterEntry> lockPersisterParameters = new ArrayList<SimpleParameterEntry>();
         lockPersisterParameters.addAll(wsEntry.getLockManager().getPersister().getParameters());
         lockPersisterEntry.setParameters(lockPersisterParameters);
         lockManagerEntry.setPersister(lockPersisterEntry);
      }

      WorkspaceEntry workspaceEntry = new WorkspaceEntry();
      workspaceEntry.setContainer(containerEntry);
      workspaceEntry.setCache(cacheEntry);
View Full Code Here

      params.addAll(copyList(baseWorkspaceEntry.getCache().getParameters()));
      CacheEntry cacheEntry = new CacheEntry(params);
      cacheEntry.setType(baseWorkspaceEntry.getCache().getType());

      // Lock
      LockManagerEntry lockManagerEntry = new LockManagerEntry();
      lockManagerEntry.setType("org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl");
      lockManagerEntry.putParameterValue("time-out", "15m");
      lockManagerEntry.putParameterValue("jbosscache-configuration", "conf/standalone/test-jbosscache-lock.xml");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.name", "jcrlocks");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.create", "true");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.drop", "false");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.primarykey",
         "jcrlocks_" + IdGenerator.generate());
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.fqn.column", "fqn");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.node.column", "node");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.parent.column", "parent");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.datasource", baseWorkspaceEntry.getContainer()
         .getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME));
      lockManagerEntry.putParameterValue("jbosscache-shareable", "${jbosscache-shareable}");

      WorkspaceEntry workspaceEntry = new WorkspaceEntry();
      workspaceEntry.setContainer(containerEntry);
      workspaceEntry.setCache(cacheEntry);
      workspaceEntry.setQueryHandler(qEntry);
View Full Code Here

      cacheParams.add(new SimpleParameterEntry("liveTime", "20m"));
      CacheEntry cacheEntry = new CacheEntry(cacheParams);
      cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl");

      // Lock
      LockManagerEntry lockManagerEntry = new LockManagerEntry();
      lockManagerEntry.setType("org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl");
      lockManagerEntry.putParameterValue("time-out", "15m");
      lockManagerEntry.putParameterValue("jbosscache-configuration", "conf/standalone/test-jbosscache-lock.xml");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.name", "jcrlocks");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.create", "true");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.drop", "false");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.primarykey",
         "jcrlocks_" + IdGenerator.generate());
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.fqn.column", "fqn");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.node.column", "node");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.parent.column", "parent");
      lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.datasource", dsName);
      lockManagerEntry.putParameterValue("jbosscache-shareable", "${jbosscache-shareable}");

      WorkspaceEntry workspaceEntry = new WorkspaceEntry();
      workspaceEntry.setLockManager(lockManagerEntry);
      workspaceEntry.setContainer(containerEntry);
      workspaceEntry.setCache(cacheEntry);
View Full Code Here

   @Override
   protected List<String> getTableNames()
   {
      List<String> tableNames = new ArrayList<String>();

      LockManagerEntry lockManagerEntry = config.getLockManager();
      if (lockManagerEntry != null)
      {
         for (SimpleParameterEntry entry : lockManagerEntry.getParameters())
         {
            if (entry.getName().equals(INFINISPAN_JDBC_TABLE_NAME))
            {
               tableNames.add(entry.getValue());
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.config.LockManagerEntry

Copyright © 2018 www.massapicom. 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.