Examples of SessionImpl


Examples of org.exoplatform.services.jcr.impl.core.SessionImpl

   }

   public synchronized void onCloseSession(ExtendedSession session)
   {
      // List<String> deadLocksList = new ArrayList<String>();
      SessionImpl sessionImpl = (SessionImpl)session;
      for (Iterator<Map.Entry<String, LockData>> entries = locks.entrySet().iterator(); entries.hasNext();)
      {
         Map.Entry<String, LockData> entry = entries.next();
         LockData lockData = entry.getValue();
         if (lockData.isLive())
         {
            if (lockData.isLockHolder(session.getId()))
            {
               if (lockData.isSessionScoped())
               {
                  // if no session currently holds lock except this
                  try
                  {
                     ((NodeImpl)sessionImpl.getTransientNodesManager().getItemByIdentifier(
                        lockData.getNodeIdentifier(), false)).unlock();
                  }
                  catch (UnsupportedRepositoryOperationException e)
                  {
                     log.error(e.getLocalizedMessage());
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.SessionImpl

      // mix:versionable
      // we have to be sure that any versionable node somewhere in repository
      // doesn't refers to a VH of the node being deleted.
      for (String wsName : repository.getWorkspaceNames())
      {
         SessionImpl wsSession = repository.getSystemSession(wsName);
         try
         {
            for (PropertyData sref : wsSession.getTransientNodesManager().getReferencesData(vhID, false))
            {
               // Check if this VH isn't referenced from somewhere in workspace
               // or isn't contained in another one as a child history.
               // Ask ALL references incl. properties from version storage.
               if (sref.getQPath().isDescendantOf(Constants.JCR_VERSION_STORAGE_PATH))
               {
                  if (!sref.getQPath().isDescendantOf(vhnode.getQPath())
                     && (containingHistory != null ? !sref.getQPath().isDescendantOf(containingHistory) : true))
                     // has a reference to the VH in version storage,
                     // it's a REFERENCE property jcr:childVersionHistory of
                     // nt:versionedChild
                     // i.e. this VH is a child history in an another history.
                     // We can't remove this VH now.
                     return;
               }
               else if (!currentWorkspaceName.equals(wsName))
               {
                  // has a reference to the VH in traversed workspace,
                  // it's not a version storage, i.e. it's a property of versionable
                  // node somewhere in ws.
                  // We can't remove this VH now.
                  return;
               } // else -- if we has a references in workspace where the VH is being
               // deleted we can remove VH now.
            }
         }
         finally
         {
            wsSession.logout();
         }
      }

      // remove child versions from VH (if found)
      // ChildVersionRemoveVisitor cvremover = new
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.SessionImpl

         try
         {
            TransactionChangesLog allChanges = new TransactionChangesLog();
            for (Map.Entry<PlainChangesLog, SessionImpl> entry : changes.entrySet())
            {
               SessionImpl session = entry.getValue();
               // first check if the tx was not too long
               if (session.hasExpired())
               {
                  // at least one session has expired so we abort the tx
                  throw new RepositoryException("The tx was too long, at least one session has expired.");
               }
               // Add the change following the chronology order
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.SessionImpl

            Map<PlainChangesLog, SessionImpl> changes = xidCtx.getMapChanges();
            if (changes != null && !changes.isEmpty())
            {
               for (Map.Entry<PlainChangesLog, SessionImpl> entry : changes.entrySet())
               {
                  SessionImpl session = entry.getValue();
                  TransactionableDataManager txManager = session.getTransientNodesManager().getTransactManager();
                  // Remove the change from the tx change log. Please note that a simple reset cannot
                  // be done since the session could be enrolled in several tx, so each change need to
                  // be scoped to a given xid
                  txManager.removeLog(entry.getKey());
               }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.SessionImpl

         {

            PlainChangesLog subLog = logIterator.nextLog();
            String sessionId = subLog.getSessionId();

            SessionImpl userSession = sessionRegistry.getSession(sessionId);

            if (userSession != null)
               for (ItemState itemState : subLog.getAllStates())
               {
                  if (itemState.isEventFire())
                  {

                     ItemData item = itemState.getData();
                     try
                     {
                        int eventType = eventType(itemState);
                        if (eventType != SKIP_EVENT && isTypeMatch(criteria, eventType)
                           && isPathMatch(criteria, item, userSession) && isIdentifierMatch(criteria, item)
                           && isNodeTypeMatch(criteria, item, userSession, subLog)
                           && isSessionMatch(criteria, sessionId))
                        {

                           String path =
                              userSession.getLocationFactory().createJCRPath(item.getQPath()).getAsString(false);

                           events.add(new EventImpl(eventType, path, userSession.getUserID()));
                        }
                     }
                     catch (RepositoryException e)
                     {
                        log.error("Can not fire ActionLauncher.onSaveItems() for " + item.getQPath().getAsString()
View Full Code Here

Examples of org.hibernate.impl.SessionImpl

    //return SessionFactoryUtils.getSession(sessionFactory, true);
    return sessionFactory.getCurrentSession();
  }
 
  private EntityStatus getStatus(Object model){
    SessionImpl simpl = (SessionImpl)getSession();   
    EntityEntry entry = simpl.getPersistenceContext().getEntry(model);
    if(entry != null){
      //Persistent Object
      logger.debug("current {} is one Entity with entry in PersistenceContext.", model);
      if (entry.getStatus() != Status.DELETED) {
        logger.debug("EntityStatus: {}", EntityStatus.PERSISTENT );
View Full Code Here

Examples of org.hibernate.internal.SessionImpl

    final String sql = "select "+seqName+".nextval  from dual";
   
    Connection conn = null;
    PreparedStatement ps = null;
    ResultSet rs = null;
    SessionImpl session = null;
    try{
      session = ((SessionImpl)getEntityManager().getDelegate());
      conn = session.connection();
      ps = conn.prepareStatement(sql);
      rs = ps.executeQuery();
      while(rs.next()){
        return rs.getLong(1);
      }
View Full Code Here

Examples of org.infinispan.cli.interpreter.session.SessionImpl

   }

   @ManagedOperation(description = "Creates a new interpreter session")
   public String createSessionId(String cacheName) {
      String sessionId = UUID.randomUUID().toString();
      SessionImpl session = new SessionImpl(codecRegistry, cacheManager, sessionId);
      sessions.put(sessionId, session);
      if (cacheName != null) {
         session.setCurrentCache(cacheName);
      }
      return sessionId;
   }
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.